
B
CCodes
这个作者很懒,什么都没留下…
展开
-
backgrnd.c
#include void main(void) { int color; for (color = 0; color { textbackground(color); cprintf("This is color %d/r/n", color); cprintf("Press any key to continue/r/n"); ge原创 2007-11-08 00:19:00 · 465 阅读 · 0 评论 -
biosmem.c
#include #include void main(void) { printf("BIOS Memory report %dKb/n", biosmemory()); printf("BIOS Memory report %dKb/n", _bios_memsize()); }原创 2007-11-08 12:23:00 · 409 阅读 · 0 评论 -
biostime.c
#include #include void main(void) { long ticks; ticks = biostime(0, ticks); printf("Ticks since midnight %ld/n", ticks); _bios_timeofday(_TIME_GETCLOCK, &ticks); printf("Seconds原创 2007-11-08 12:23:00 · 719 阅读 · 0 评论 -
bit_and.c
#include void main(void) { printf("0 & 0 is %d/n", 0 & 0); printf("0 & 1 is %d/n", 0 & 1); printf("1 & 1 is %d/n", 1 & 1); printf("1 & 2 is %d/n", 1 & 2); printf("15 & 127 is %d/n", 15 &原创 2007-11-08 12:24:00 · 345 阅读 · 0 评论 -
bk_list.cpp
#include #include #include class Book { public: Book(char *title, char *author, char *publisher, float price); // Constructor Book() {}; void show_title(void); float get_price(void);原创 2007-11-08 12:26:00 · 465 阅读 · 0 评论 -
bubble.cpp
#include template void bubble_sort(X *items, int size)template void show_items(X *items, int size)void main(void) { int iarray[7] = {7, 5, 4, 3, 9, 8, 6}; double darray[5] = {4.2, 2原创 2007-11-08 12:28:00 · 353 阅读 · 0 评论 -
baseder2.cpp
#include class Base { public: Base(void) { cout int data; };class Derived:public Base { public: Derived(void): Base() { cout };void main(void) { Derived object; object.data = 5;原创 2007-11-08 12:20:00 · 317 阅读 · 0 评论 -
baseder3.cpp
#include class Base { public: Base(void) { cout int data; };class Derived: private Base { public: Derived(void): Base() { cout };void main(void) { Derived object; object.data =原创 2007-11-08 12:21:00 · 366 阅读 · 0 评论 -
bdos.c
#include #include void main(void) { int drive; drive = bdos(0x19, 0, 0); printf("Current drive is %c/n", A + drive); }原创 2007-11-08 12:22:00 · 356 阅读 · 0 评论 -
bible.c
#include void main(void) { printf("Jamsa/抯 C/C++ Programmer/抯 Bible"); }原创 2007-11-08 12:22:00 · 294 阅读 · 0 评论 -
bin_copy.cpp
#include #include #include void main(int argc, char **argv) { char buffer[1]; ifstream input(argv[1], ios::in | ios::binary); if (input.fail()) { cout exit(1); } ofst原创 2007-11-08 12:23:00 · 385 阅读 · 0 评论 -
bit_xor.c
#include void main(void) { printf("0 ^ 0 is %d/n", 0 ^ 0); printf("0 ^ 1 is %d/n", 0 ^ 1); printf("1 ^ 1 is %d/n", 1 ^ 1); printf("1 ^ 2 is %d/n", 1 ^ 2); printf("15 ^ 127 is %d/n", 15 ^原创 2007-11-08 12:25:00 · 423 阅读 · 0 评论 -
bool_fun.cpp
#include bool func(void) { // Function returns a bool type return false; // return NULL; // NULL is converted to Boolean false }void main(void) { bool val = false; // Boolean var原创 2007-11-08 12:27:00 · 515 阅读 · 0 评论 -
bsearch.c
#include #include int compare_int(int *a, int *b) { return(*a - *b); }int compare_float(float *a, float *b) { return((*a == *b) ? 0: 1); }void main(void) { int int_values[] = {1, 3, 2, 4原创 2007-11-08 12:27:00 · 585 阅读 · 0 评论 -
binary.c
#include int binary_search(int array[], int value, int size) { int found = 0; int high = size, low = 0, mid; mid = (high + low) / 2; printf("/n/nLooking for %d/n", value); while ((原创 2007-11-08 12:23:00 · 464 阅读 · 0 评论 -
baseptr.cpp
#include class Base { public: void base_message(void) { cout };class Derived: public Base { public: void derived_message(void) { cout };void main(void) { Base *base_pointer = new Base;原创 2007-11-08 12:21:00 · 310 阅读 · 0 评论 -
basename.cpp
#include class Base { public: void show_message(void) { cout };class Derived: public Base { public: void show_message(void) { cout };void main(void) { Base *base_pointer = new Base; ba原创 2007-11-08 12:21:00 · 355 阅读 · 0 评论 -
bitscout.cpp
#include void main(void) { unsigned int value, one = 1; value = one cout cout }原创 2007-11-08 12:24:00 · 371 阅读 · 0 评论 -
bit_or.c
#include void main(void) { printf("0 | 0 is %d/n", 0 | 0); printf("0 | 1 is %d/n", 0 | 1); printf("1 | 1 is %d/n", 1 | 1); printf("1 | 2 is %d/n", 1 | 2); printf("128 | 127 is %d/n", 128原创 2007-11-08 12:25:00 · 519 阅读 · 0 评论 -
bld_lib.cpp
#include #include class Book { public: Book(char *title) { strcpy(Book::title, title); }; void show_title(void) { cout private: char title[64];};class LibraryCard : public Book { p原创 2007-11-08 12:26:00 · 403 阅读 · 0 评论 -
brk.c
#include #include void main(void) { char *ptr; printf("Starting heap available %u/n", coreleft()); ptr = malloc(1); // Get pointer to current break value if (brk(ptr + 512) == 0原创 2007-11-08 12:27:00 · 475 阅读 · 0 评论 -
buildabc.c
#include void main(void) { char string[256]; int i; for (i = 0; i string[i] = A + i; string[i] = NULL; printf ("The string contains %s/n", string); }原创 2007-11-08 12:28:00 · 365 阅读 · 0 评论 -
beeps.c
#include #include void main(int argc, char *argv[]) { int count; // The number of times to sound the speaker int i; // The number of times the speaker has been sounded // Determine t原创 2007-11-08 12:22:00 · 352 阅读 · 0 评论 -
bit_inv.c
#include void main(void) { int value = 0xFF; printf("The inverse of %X is %X/n", value, ~value); }原创 2007-11-08 12:25:00 · 479 阅读 · 0 评论 -
bld_1_10.c
#include #include void main(void) { int i; struct ListEntry { int number; struct ListEntry *next; struct ListEntry *previous; } start, *node, *new; start.next = NULL; /原创 2007-11-08 12:26:00 · 458 阅读 · 0 评论 -
bookfunc.cpp
#include #include #include class Book { public: char title[256]; char author[64]; float price; void show_title(void); float get_price(void); void show_book(void); void as原创 2007-11-08 12:26:00 · 352 阅读 · 0 评论 -
bufferio.c
#include void main(void) { int letter; do { letter = getchar(); putchar(letter); } while (letter != /n); }原创 2007-11-08 12:28:00 · 554 阅读 · 0 评论 -
bvectr1.cpp
#ifdef __BCPLUSPLUS__#include #include #else#include #include #endifusing namespace std;const ARRAY_SIZE = 4;void main(void){ // Dynamically allocated vector begins with 0 elements. bit_vect原创 2007-11-08 12:29:00 · 324 阅读 · 0 评论 -
backward.c
#include void display_backward(char *string) { if (*string) { display_backward(string+1); putchar(*string); } }void main(void) { display_backward("ABCDE"); }原创 2007-11-08 00:19:00 · 390 阅读 · 0 评论 -
basederi.cpp
#include class Base { public: Base(void) { cout };class Derived:Base { public: Derived(void): Base() { cout };void main(void) { Derived object; }原创 2007-11-08 12:21:00 · 300 阅读 · 0 评论 -
bubble.c
#include #include void bubble_sort(int array[], int size) { int temp, i, j; for (i = 0; i for (j = 0; j if (array[i] { temp = array[i]; array[i] = array[j原创 2007-11-08 12:27:00 · 543 阅读 · 0 评论