[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

The contents of the file is not read..



Hello,

i'm a beginner in C. I used the following code to read and print the strings in a file. but the control doesn't reach inside the while loop. what is the problem?

FILE *FilesRead=fopen("FilesRead.txt","r");
   if(!FilesRead)
       printf("File not opened");
   else
       printf("Opened file");
   while(!EOF)
   {
       fscanf(FilesRead,"%s",name_read);
       printf("%s",name_read);
   }
   fclose(FilesRead);

The file FileRead already exists and it has some strings seperated by tabs.

thank u,
-Naga Priya.k.

##############################################################################################################################################
The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination, copying or other use of, or taking any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited. If you have received this in error, please contact the sender and delete
the material from your system. Accord Software & Systems Pvt. Ltd. (ACCORD) is not responsible for any changes made to the material other
than those made by ACCORD or for the effect of the changes on the meaning of the material.
##############################################################################################################################################
begin:vcard
fn:Naga Priya
n:;Naga Priya
email;internet:naga.priya@accord-soft.com
note;quoted-printable:Dont think about the past..=0D=0A=
	Dont worry about future..=0D=0A=
	Enjoy the present...
version:2.1
end:vcard


Reply to: