วันพุธที่ 8 กรกฎาคม พ.ศ. 2552

คำสั่งของภาษาซี

// Read from File with word split#include int main() { FILE *fp; char userFile[40] = {"x.cpp"}; fp = fopen(userFile,"r"); char info[100]; while((fscanf(fp,"%s",info)) != EOF) printf("%s\n",info); fclose(fp); return 0;}

// Write to File#include int main() { FILE *fp; char userFile[40] = {"y.txt"}; fp = fopen(userFile,"w"); fprintf(fp, "abc"); fclose(fp); return 0;}
// Assemblychar my_getch() {char chr;_asm {mov ah, 07HINT 21Hmov chr, al}return chr;}