- This topic has 0 replies, 1 voice, and was last updated 17 years, 3 months ago by .
Viewing 0 reply threads
Viewing 0 reply threads
- The forum ‘C Programming’ is closed to new topics and replies.
Home › Forums › C Programming › need hlep in file handling
hi,
i write a program but it doen’t work well .hlep to indentify my mistake program is
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include<stdio.h><br /> #include<conio.h><br /> main()<br /> {<br /> FILE *fptr;<br /> char ch="NULL",*name;<br /> printf("Enter the name for file :");<br /> scanf("%s",name);<br /> <br /> fptr=fopen(name,"a+");<br /> <br /> if (fptr==NULL)<br /> {<br /> printf("File does not existn");<br /> exit(1);<br /> }<br /> while(1)<br /> {<br /> /*gets(ch);*/<br /> if (gets(&ch) == 'n')<br /> break;<br /> else<br /> {<br /> putc(ch,fptr);<br /> }<br /> }<br /> <br /> fclose(fptr);<br /> getch();<br /> } |
………………………………if u find any mistake mail me at [email protected]