read files in c
#include<stdio.h>
int main(){
FILE *in=fopen("name_of_file.txt","r");
char c;
while((c=fgetc(in))!=EOF)
putchar(c);
fclose(in);
return 0;
}
read files in c
#include<stdio.h>
int main(){
FILE *in=fopen("name_of_file.txt","r");
char c;
while((c=fgetc(in))!=EOF)
putchar(c);
fclose(in);
return 0;
}
read from command line c
#include <stdio.h>
int main(int argc, char **argv) {
for (int i = 0; i < argc; ++i) {
printf("argv[%d]: %s\n", i, argv[i]);
}
}
/*
[birryree@lilun c_code]$ ./a.out hello there
argv[0]: ./a.out
argv[1]: hello
argv[2]: there
*/
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us