Hi , I am new in C Programming ,
I have some code that i write below :
Usually i wanted to do is the program reads each line a text file and put it into a structurer array . But in my text file , i got 1 line of data looks like thisCode:int i ; for (i = 0; i < Seat ; i++) { fscanf(fp, "%s %d %d",&Seats[i].strName,Seats[i].available,&Seats[i].type); } printf("\n\nData successfully loaded..."); fclose(fp);
Jason Liew 0 1
So i try to printf and see wether the data is it inside the array , but when i type Seat[0].strName , it just show a string "Jason" only , and "Liew" is gone , I was thinking for so long how to wrap the name together . Can anyone guide me and explain what i have go wrong? Thanks
Regards, kekewong



LinkBack URL
About LinkBacks


