|
| CD4 (25) | |||
hello i am a newbie.. i had been following Beginning linux programming 4th edition. I tried to go for a sample but the data isnt getting copied to other file but the new file files.in is formed
please help..thanks in advance | |||
| Duoas (2964) | |
| Line 19 has a stray semicolon. | |
| CD4 (25) | |
| well thanks for pointing out (;) mistake but still files.in is empty.the data from files.out1 hasn't been copied to it.please help | |
| Duoas (2964) | |
| It is because your file handling is scrambled. Line 12: you open a file for writing Line 13: you write some stuff to it Line 14: you check to see whether the file opened properly (non sequitur) Line 19: you try to read stuff from the output file (that you just created and left the file pointer at the end of it) Try putting a lseek(op,0,SEEK_SET); before line 19 and see what that does.You might also want to swap lines 13 and 14. Hope this helps. | |
Last edited on | |
| CD4 (25) | ||||
hello duoas.. i am a coplete newbie so its not getting clear.. i re-wrote the program with many changes where the eror was taking place.. can you explain abit more on wats the problem..
shell output::
| ||||
Registered users can post in this forum.
