
C
CCodes
这个作者很懒,什么都没留下…
展开
-
char_out.c
#include void main(void) { printf("The letter is %c/n", A); printf("The letter is %c/n", 65); }原创 2007-11-08 12:32:00 · 344 阅读 · 0 评论 -
check_filesize.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 12:33:00 · 319 阅读 · 0 评论 -
chgfirst.c
#include void change_first(int *first, int second) { *first = second; // Assign value of second to first }void main(void) { int a = 0, b = 5; change_first(&a, b); printf("Value of a原创 2007-11-08 12:34:00 · 383 阅读 · 0 评论 -
chk_ansi.c
#include void main(void) { #ifdef __STDC__ printf("ANSI C compliance/n"); #else printf("Not in ANSI C mode/n"); #endif }原创 2007-11-08 12:36:00 · 295 阅读 · 0 评论 -
chmember.c
#include struct Shape { int type; int color; float radius; float area; float perimeter;};void change_structure(struct Shape *shape) { shape->type = 0; shape->color = 1; shape->radius原创 2007-11-08 12:39:00 · 320 阅读 · 0 评论 -
client.h
// Various buffer sizes#define IN_BUF_SIZE 1000#define OUT_BUF_SIZE 1000#define PLEASE_READ 1000#define PLEASE_WRITE 1000#define LINE_LEN 80#define NAME_SIZE原创 2007-11-08 12:42:00 · 501 阅读 · 0 评论 -
clrscr.c
#include void main(void) { clrscr(); }原创 2007-11-08 12:43:00 · 493 阅读 · 0 评论 -
clr_wnew.cpp
#include void clrscr(int size=25) { while(size > 0) { cout size--; } }void main(void) { int i; for(i=0; i cout cin.get(); clrscr(); // clears原创 2007-11-08 12:43:00 · 438 阅读 · 0 评论 -
cmd_cnt.c
#include void main(int argc, char *argv[]) { printf ("The number of command line entries is %d/n", argc); }原创 2007-11-08 12:43:00 · 423 阅读 · 0 评论 -
cnt_read.cpp
#include #include void main(void) { float fnum[4] = {99.75, -34.4, 1776.0, 200.1}; int i; ofstream out("numbers.asc", ios::out | ios::binary); if(!out) { cout exit (1);原创 2007-11-08 12:45:00 · 405 阅读 · 0 评论 -
comment.c
// Program: COMMENT.C// Written by: Kris Jamsa and Lars Klander// Date written: 08-22-97// Purpose: Illustrates the use of comments in a C program.#include void main(void) { printf ("Jamsa/原创 2007-11-08 12:45:00 · 584 阅读 · 0 评论 -
compact.c
#include void main(void) { int a = 1, b, c, d; switch (a) { case 1: a = 5; b = 6; c = 7; d = 8; break; case 2: b = 6; c = 7;原创 2007-11-08 12:46:00 · 355 阅读 · 0 评论 -
com_over.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 12:47:00 · 327 阅读 · 0 评论 -
conflict.c
#include int a = 1, b = 2, c = 3; // Global variablesvoid conflict_a(void) { int a = 100; printf("a contains %d b contains %d c contains %d/n", a, b, c); }void main(void) { conflict_a原创 2007-11-08 12:48:00 · 317 阅读 · 0 评论 -
conflict.cpp
#include class Base { public: void display(void) { cout };class Derived: public Base { public: void display(void) { cout };void main(void) { Derived my_class; my_class.display(); }原创 2007-11-08 12:48:00 · 422 阅读 · 0 评论 -
convert.cpp
#include #include struct BookInfo { char title[64]; char publisher[64]; char author[64]; float price; int pages;};class BookStuff { public: BookStuff(char *title, char *publisher, char原创 2007-11-08 12:50:00 · 359 阅读 · 0 评论 -
con_vowl.c
#include void main(void) { char letter; int vowel_count = 0; int consonant_count = 0; for (letter = A; letter switch (letter) { case A: case E: case I:原创 2007-11-08 12:52:00 · 580 阅读 · 0 评论 -
copydos.c
#include #include void main(int argc, char **argv) { union REGS inregs, outregs; struct SREGS segs; char buffer[256]; unsigned source_handle, target_handle; if (*argv[1] && *原创 2007-11-08 12:52:00 · 467 阅读 · 0 评论 -
copy_con.cpp
#include #include class array { int *p; int size; public: array(int sz) { // simple constructor p = new int[sz]; if(!p) exit(1); size = sz; } ~array() {delete [原创 2007-11-08 12:53:00 · 319 阅读 · 0 评论 -
create_copy.cpp
#include #include "Create_Copy.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 && (原创 2007-11-08 13:01:00 · 414 阅读 · 0 评论 -
create_dialog.h
#define IDM_EXIT 100#define IDM_TEST 200#define IDM_ABOUT 301#define IDC_CHECKBOX 101#define IDC_RADIO1 102#define IDC_RADIO2 103LRESULT CALLBA原创 2007-11-08 13:03:00 · 378 阅读 · 0 评论 -
create_icon.h
#define IDM_EXIT 100#define IDM_ABOUT 301LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);LRESULT CALLBACK About (HWND, UINT, WPARAM, LPARAM);原创 2007-11-08 13:15:00 · 353 阅读 · 0 评论 -
create_set.cpp
#include LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ switch (uMsg) { case WM_CREATE: // Set current directory to value passed on command line.原创 2007-11-08 13:17:00 · 420 阅读 · 0 评论 -
create_temp.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 13:18:00 · 487 阅读 · 0 评论 -
crosshatch_box.cpp
#include #include "Crosshatch_Box.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 &原创 2007-11-08 13:20:00 · 529 阅读 · 0 评论 -
ctime.c
#include #include void main(void) { time_t current_time; time(¤t_time); // Get the time in seconds; printf("The current date and time: %s", ctime(¤t_time)); }原创 2007-11-08 13:21:00 · 444 阅读 · 0 评论 -
call_2.c
#include void hello_world(void) { printf("Hello, world!/n"); }void three_hellos(void) { int counter; for (counter = 1; counter hello_world(); }void main(void) { three_hellos();原创 2007-11-08 12:29:00 · 299 阅读 · 0 评论 -
catch_ml.cpp
#include void XHandler(int test) { try { if(test==0) throw test; if(test==1) throw a; if(test==2) throw 123.23; } catch(...) { cout } }void main(void) {原创 2007-11-08 12:30:00 · 385 阅读 · 0 评论 -
check_filesize.cpp
#include #include "Check_FileSize.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 &&原创 2007-11-08 12:33:00 · 313 阅读 · 0 评论 -
chkconst.c
#include void no_change(const char *string) { while (*string) *string++ = toupper(*string); } void main(void) { char title[] = "Jamsa/s C/C++ Programmer/s Bible"; no_change(ti原创 2007-11-08 12:36:00 · 248 阅读 · 0 评论 -
chk_cpp.c
#include void main(void) { #ifdef __cplusplus printf("Using C++/n"); #else printf("Using C/n"); #endif }原创 2007-11-08 12:37:00 · 320 阅读 · 0 评论 -
chk_file.cpp
#include "strings.h"#include #include //executable file extensionschar ext[3][4] = { "EXE", "COM", "BAT" };void main(int argc, char *argv[]){ Strings fname; int i; if(argc != 2) { cout ex原创 2007-11-08 12:38:00 · 371 阅读 · 0 评论 -
chsize.c
#include #include #include #include #include void main(void) { int handle; if ((handle = creat("100ZEROS.DAT", S_IWRITE)) == -1) fprintf(stderr, "Error opening 100ZEROS.D原创 2007-11-08 12:39:00 · 458 阅读 · 0 评论 -
clasbeep.cpp
#include class Beepers { public: void beep(void); void beepbeep(void);}; void Beepers::beep(void) { asm { mov ah,2; mov dl,7; int 0x21; }} void原创 2007-11-08 12:40:00 · 307 阅读 · 0 评论 -
classasn.cpp
#include #include class BookStuff { public: BookStuff(char *title, char *publisher, char *author); void show_book(void) { cout author }; operator char *(); private: ch原创 2007-11-08 12:40:00 · 289 阅读 · 0 评论 -
clock.c
#include #include #include // Contains the delay prototypevoid main(void) { clock_t processor_time; printf("Processor time consumed %ld/n", clock() / (long) CLK_TCK); delay(2000原创 2007-11-08 12:42:00 · 349 阅读 · 0 评论 -
cls_parm.cpp
#include class base { protected: int i; public: base(int x) { i=x; cout } ~base(void) {cout };class derived : public base { int j; public: // derived uses x; base uses y原创 2007-11-08 12:43:00 · 265 阅读 · 0 评论 -
comment2.c
/* Program: COMMENT.C Written by: Kris Jamsa and Lars Klander Date written: 08-22-97 Purpose: Illustrates the use of comments in a C program. */#include void main(void) { printf ("Jams原创 2007-11-08 12:46:00 · 453 阅读 · 0 评论 -
confcopy.c
#include void main(void) { FILE *input, *output; int letter; if ((input = fopen("//CONFIG.SYS", "r")) == NULL) printf("Error opening //CONFIG.SYS/n"); else if ((output = fopen("//CON原创 2007-11-08 12:47:00 · 275 阅读 · 0 评论 -
const.cpp
#include class c { public: int j; c(void) {j=10;} };void PrintInt(const c* Object) { c* New = Object; New->j +=5; printf("%d/n", New->j); }void main(void) { const c Sample; PrintI原创 2007-11-08 12:48:00 · 260 阅读 · 0 评论