How to save data to a file using FILES in C???
pls show me some formats...
How to save data to a file using FILES in C???
pls show me some formats...
Code:#include <stdio.h> #include <fcntl.h> #include <string.h> typedef int FLIES; int main (int argc, char *argv[]) { char content[]="data"; FLIES away=open(argv[1],O_WRONLY | O_CREAT), x=1; if (!(argv[1])) { puts("You didn't specify a filename."); return -1; } if (write(away,content,strlen(content))<3) perror("write"); close(away); return 0; }
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge