Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

write varriable in file C

FILE* f = fopen("number.txt", "w");  // open the file for writing
 if (f != NULL)                       // check for success
 {
     fprintf(f, "%d", 42);            // write the number 42 as a string
     fclose(f);                       // close the file
     f = NULL;                        // set file handle to null since f is no longer valid
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #write #varriable #file #C
ADD COMMENT
Topic
Name
9+3 =