
T
CCodes
这个作者很懒,什么都没留下…
展开
-
two_line.c
#include void main(void) { printf ("This is line one./n"); printf ("This is the second line."); }原创 2007-11-08 23:24:00 · 408 阅读 · 0 评论 -
tee.c
#include void main(void) { char buffer[256]; while (fgets(buffer, sizeof(buffer), stdin)) { fputs(buffer, stdout); fputs(buffer, stderr); } }原创 2007-11-08 23:08:00 · 619 阅读 · 0 评论 -
task_man.cpp
#include #include "Task_Man.h" #if defined (WIN32) #define IS_WIN32 TRUE#else #define IS_WIN32 FALSE#endif#define IS_NT IS_WIN32 && (BOOL)(GetVersion() #define IS_WIN32S IS_WIN32 && (BOO原创 2007-11-08 23:07:00 · 407 阅读 · 0 评论 -
txtcolor.c
#include void main(void) { int color; for (color = 1; color { textcolor(color); cprintf("This is color %d/r/n", color); } textcolor(128 + 15); cprintf("This is blinking/r/n");原创 2007-11-08 23:24:00 · 607 阅读 · 0 评论 -
two_objs.cpp
#include #include class Book { public: Book(char *title) { strcpy(Book::title, title); } ; void show_book(void) { cout private: char title[64];}; class Reader { public: Reader(原创 2007-11-08 23:24:00 · 464 阅读 · 0 评论 -
two_icons.h
#define IDM_EXIT 100#define IDM_TEST 200#define IDM_ABOUT 301LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);LRESULT CALLBACK About (HWND, UINT, WPARAM, LPAR原创 2007-11-08 23:23:00 · 429 阅读 · 0 评论 -
toupper.c
#include #include void main(void) { char string[] = "Jamsa/s C/C++ Programmer/s Bible"; int i; for (i = 0; string[i]; i++) putchar(toupper(string[i])); putchar(/n); for (i =原创 2007-11-08 23:17:00 · 412 阅读 · 0 评论 -
too_big.c
void main(void) { char string[66000L]; // 66,000 bytes int values[33000L]; // 33,000 * 2 = 66,000 bytes float numbers[17000]; // 17,000 * 4 = 68,000 bytes }原创 2007-11-08 23:17:00 · 385 阅读 · 0 评论 -
tolower.c
#include #include void main(void) { char string[] = "Jamsa/s C/C++ Programmer/s Bible"; int i; for (i = 0; string[i]; i++) putchar(tolower(string[i])); putchar(/n); for (i =原创 2007-11-08 23:16:00 · 505 阅读 · 0 评论 -
tempnam.c
#include void main(void) { char buffer[64]; int counter; printf("Temporary filename %s/n", tempnam(buffer, "Bible")); }原创 2007-11-08 23:11:00 · 529 阅读 · 0 评论 -
testcpp.cpp
#ifdef __cplusplus#include #else#include #endifvoid main(void) {#ifdef __cplusplus cout #else printf("C compilation/n");#endif }原创 2007-11-08 23:12:00 · 383 阅读 · 0 评论 -
two_icons.cpp
#include #include "Two_Icons.h" #if defined (WIN32) #define IS_WIN32 TRUE#else #define IS_WIN32 FALSE#endif#define IS_NT IS_WIN32 && (BOOL)(GetVersion() #define IS_WIN32S IS_WIN32 && (BO原创 2007-11-08 23:23:00 · 501 阅读 · 0 评论 -
two_frn.cpp
#include class loc { int longitude, latitude; public: loc(void) {} // Used to construct temporaries loc (int lg, int lt) { longitude = lg; latitude = lt;原创 2007-11-08 23:22:00 · 388 阅读 · 0 评论 -
tst_max.cpp
#include #include "tst_max.h"#if defined (win32) #define IS_WIN32 TRUE#else #define IS_WIN32 FALSE#endifHINSTANCE hInst; // current instanceLPCTSTR lpszAppName = "Generic";LPCTSTR lpszT原创 2007-11-08 23:18:00 · 523 阅读 · 0 评论 -
tryauto.c
#include #include #include #include void main(void) { int handle; int offset = 0; int bytes_read; char buffer[128]; if ((handle = sopen("//AUTOEXEC.BAT", O_BINARY | O_RDONLY, SH_DENYNO原创 2007-11-08 23:18:00 · 409 阅读 · 0 评论 -
third_pw.cpp
// If you use Visual C++, set the compile options to /GX#ifdef __BCPLUSPLUS__#include #include #include #else#include #include #include #endifusing namespace std;void PrintCube(int n){ // pr原创 2007-11-08 23:14:00 · 825 阅读 · 0 评论 -
textcopy.c
#include void main(int argc, char **argv) { FILE *input, *output; char string[256]; if ((input = fopen(argv[1], "r")) == NULL) printf("Error opening %s/n", argv[1]); else if ((out原创 2007-11-08 23:13:00 · 373 阅读 · 0 评论 -
textattr.c
#include void main(void) { int color; for (color = 1; color { textattr(color); cprintf("This is color %d/r/n", color); } textattr(128 + 15); cprintf("This is blinking/r/n"); }原创 2007-11-08 23:13:00 · 459 阅读 · 0 评论 -
test_a.c
#include #include void main(void) { char buffer[8192]; // Try reading head 1, track 1, sector 1 if (biosdisk(2, 0, 1, 1, 1, 1, buffer)) printf("Error accessing drive/n"); else pr原创 2007-11-08 23:12:00 · 360 阅读 · 0 评论 -
tmpnam.c
#include void main(void) { char buffer[64]; int counter; for (counter = 0; counter printf("Temporary filename %s/n", tmpnam(buffer)); }原创 2007-11-08 23:16:00 · 419 阅读 · 0 评论 -
three_options.cpp
#include // Add these menu options.#define IDM_READ 201#define IDM_WRITE 202// Windows message procedure.LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ sta原创 2007-11-08 23:15:00 · 459 阅读 · 0 评论 -
tzname.c
#include #include void main(void) { tzset(); printf("Current time zone is %s/n", tzname[0]); if (tzname[1]) printf("Daylight savings zone is %s/n", tzname[1]); else printf("Day原创 2007-11-08 23:26:00 · 558 阅读 · 0 评论 -
three_hi.c
#include void three_hellos(void) { int counter; // Variable for (counter = 1; counter printf("Hello, world!/n"); }void main(void) { three_hellos(); }原创 2007-11-08 23:15:00 · 367 阅读 · 0 评论 -
threelvl.cpp
#include class Base { public: void show_base(void) { cout };class Level1 : public Base { public: void show_level1(void) { show_base(); cout };};class Level2 : public Lev原创 2007-11-08 23:14:00 · 336 阅读 · 0 评论 -
textinfo.c
#include void main(void) { struct text_info text; gettextinfo(&text); cprintf("Screen coordinates %d,%d to %d,%d/r/n", text.wintop, text.winleft, text.winbottom, text.winright);原创 2007-11-08 23:14:00 · 345 阅读 · 0 评论 -
tentatve.c
#include int value;void main(void) { printf("%d/n", value); }int value = 1500;原创 2007-11-08 23:12:00 · 424 阅读 · 0 评论 -
template.cpp
#include template T add_values(T a, T1 b) { return(a + b); }long add_values(long a, int b);double add_values(double a, float b);void main(void) { long a = 320000L; int b = 31000;原创 2007-11-08 23:11:00 · 528 阅读 · 0 评论 -
tellattr.c
#include #include #include void main(int argc, char *argv[]) { int attributes; if ((attributes = _chmod(argv[1], 0)) == -1) printf("Error accessing %s/n", argv[1]); else {原创 2007-11-08 23:11:00 · 343 阅读 · 0 评论 -
tell.c
#include #include #include void main(void) { int handle; char buffer[512]; int bytes_read; if ((handle = open("//CONFIG.SYS", O_RDONLY)) == -1) printf("Error opening //CONFIG.SYS/n")原创 2007-11-08 23:10:00 · 484 阅读 · 0 评论 -
tee.cpp
#include void main(void) { char letter; while ((letter = cin.get()) != -1) { cout.put(letter); cerr.put(letter); } }原创 2007-11-08 23:10:00 · 747 阅读 · 0 评论 -
timer.c
#include #include #include int alphanum = 0;int counter = 0;void interrupt far handler(void) { if (++counter == 273) // 15 seconds { alphanum = !alphanum; // Toggle counte原创 2007-11-08 23:15:00 · 439 阅读 · 0 评论 -
timezone.c
#include #include void main(void) { tzset(); printf("Difference between local and GMT is %d hours/n", timezone / 3600); }原创 2007-11-08 23:16:00 · 406 阅读 · 0 评论 -
typeid_2.cpp
#include #include class Base { int a, b; virtual void func(void) {}; };class Derived1: public Base { int i, j; }class Derived2: public Base { int k; }void main(void) { int i; Bas原创 2007-11-08 23:25:00 · 469 阅读 · 0 评论 -
typeid_1.cpp
#include #include class A { };class B : A { };void main(void) { char C; float X; //USE THE typeinfo::operator == () TO MAKE COMPARISON if (typeid( C ) == typeid( X ))原创 2007-11-08 23:25:00 · 397 阅读 · 0 评论 -
two_gen.cpp
#include template class two_gen { T1 i; T2 j; public: two_gen(T1 a, T2 b) { i=a; j=b;} void show(void) { cout };void main(void) { two_gen obj1(10, 0.23); two_gen obj2(X原创 2007-11-08 23:22:00 · 512 阅读 · 0 评论 -
two_excp.cpp
#include void XHandler(void) { try { throw "hello"; } catch(char *) { cout throw; } }void main(void) { cout try { XHandler(); } catch(char *) { c原创 2007-11-08 23:22:00 · 409 阅读 · 0 评论 -
twop_ini.cpp
#include class sample { int value1; int value2; public: sample(int j, int k) // constructor { value1 = j; value2 = k; } int get_value2() {return value2;} int get_va原创 2007-11-08 23:20:00 · 566 阅读 · 0 评论 -
twocount.c
#include void beeper(int beep_count) { int count; for (count = 1; count putchar(7); }void main(void) { int count; for (count = 1; count { printf("About to beep %d tim原创 2007-11-08 23:19:00 · 451 阅读 · 0 评论 -
tst_max.h
#define IDM_EXIT 100#define IDM_TEST 200#define IDM_ABOUT 300#define DLG_VERFIRST 400#define DLG_VERLAST 404LRESULT CALLBACK WndProc(HWND, UINT, WPARA原创 2007-11-08 23:19:00 · 432 阅读 · 0 评论 -
to_upper.cpp
#include #include void main(void) { char letter; while ((letter = cin.get()) != -1) cout.put(toupper(letter)); }原创 2007-11-08 23:18:00 · 492 阅读 · 0 评论