Last active
December 10, 2019 08:27
-
-
Save winhtut/d0486a5cea54d86637de676ee53e4c55 to your computer and use it in GitHub Desktop.
FileProcessingWithC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
FILE *fptr; | |
int account=101; | |
char name[]="WinHtut"; | |
double balance=10.1; | |
fptr = fopen("1hello.txt", "w"); | |
if(fptr==NULL){ | |
printf("Somethings wrong with this process"); | |
}else{ | |
fprintf(fptr, "%d %s %.2f\n", account, name, balance); | |
fclose(fptr); | |
printf("All process are complete\n"); | |
} | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int i; | |
FILE * fptr; | |
char str[] = "We are Myanmar Crazy Coder\n"; | |
fptr = fopen("hello.txt", "w"); | |
for (i = 0; str[i] != '\n'; i++) { | |
fputc(str[i], fptr); | |
} | |
fclose(fptr); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
FILE * fptr; | |
fptr = fopen("1hello.txt", "w+"); | |
if(fptr==NULL){ | |
printf("Something wrongs"); | |
}else{ | |
fputs("Myanmar Crazy Coders(GreenHackers)\n ", fptr); | |
fputs("it is more clear than fputc() \n", fptr); | |
printf("All process are successfully"); | |
fclose(fptr); | |
} | |
return (0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment