The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled C++ Code
Posted by: zapis do souboru | April 18, 2011 @ 3:07pm
C++ Code
[
Download
]
int AddPers(char *FiName, char *FaName, char Sex, int ID1, int ID2, char *Street, int Number) { char zapis[60]; int aa; int pocet; FILE *ptrfile; ptrfile = fopen("vystrkov.txt","r+"); if (ptrfile!=NULL) { fscanf(ptrfile,"%d",&pocet); pocet++; fprintf(ptrfile,"%d",pocet); } fclose(ptrfile); for(aa=0;aa<60;aa++) zapis[aa]='\0'; ptrfile = fopen("vystrkov.txt","a+"); if (ptrfile!=NULL) { aa=sprintf(zapis,"%s %s %c %d %d %s %d\n",FiName,FaName,Sex,ID1,ID2,Street,Number); fprintf(ptrfile,"%s",zapis); } fclose(ptrfile); /* ptrfile = fopen("vystrkov.txt","rw"); if (ptrfile!=NULL) { fscanf(ptrfile,"%d",&pocet); pocet++; fprintf(ptrfile,"%d",pocet); } fclose(ptrfile); */ return pocet; }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.74 / 8
39 Votes
http://codebin.yi.org/1230
page generated in 0.01 seconds