হোমc string c program to read a string from a file byengr. ahsan arif -মার্চ ০৫, ২০১৫ 3 Write a c program to read a string from a file << Go to Index Page >> Tags c string file file programming fprintf() fscanf() pointer and file string array Facebook Twitter
#include
উত্তরমুছুনint main()
{
FILE *fp;
char buff[255];
fp=fopen("C:/test","r");
fscanf(fp,"%s",buff);
printf("%s\n",buff);
return 0;
}
#include
উত্তরমুছুন#include
int main()
{
FILE *fp;
char ch[100];
char buff;
int i;
fp=fopen("E:/FILE/salman.txt","r");
while(fscanf(fp,"%c",&ch[i])!=EOF)
{
buff=ch[i];
printf("%c",buff);
}
fclose(fp);
return 0;
}
ধন্যবাদ
উত্তরমুছুন