| | |
Deleting a record from a file
Thread Solved |
•
•
Join Date: Dec 2004
Posts: 4
Reputation:
Solved Threads: 0
hai!
(1)I have problem in deleting a record from a file.
I was told that the only way to delete a record from a file is to copy the file to another temporary file and then copy the records to the same file again by skipping the record that u need to delete i don't have problem until the copying of the file to the temporary file but i don't know how to skip the record that needs to be delete.
(2)what's the command to rename a file?
Plz anybody help me!
Urs,
PriyaJaiGanesh.
(1)I have problem in deleting a record from a file.
I was told that the only way to delete a record from a file is to copy the file to another temporary file and then copy the records to the same file again by skipping the record that u need to delete i don't have problem until the copying of the file to the temporary file but i don't know how to skip the record that needs to be delete.
(2)what's the command to rename a file?
Plz anybody help me!
Urs,
PriyaJaiGanesh.
•
•
•
•
Originally Posted by PriyaJaiGanesh
(2)what's the command to rename a file?
The rename function renames the file oldname to newname. The file formerly accessible under the name oldname is afterwards accessible as newname instead. If rename fails, it returns -1.
•
•
•
•
(1)I have problem in deleting a record from a file.
C Syntax (Toggle Plain Text)
int rec_to_delete = 2; // record 3 is index 2 for(int i = 0; i < 9; i++) { if(i != rec_to_delete) { // copy record } }
use the if statement so that the record number you want to delete doesnt get copied.
http://sales.carina-e.com
no www
no nonsense
coming soon to a pc near you! :cool:
no www
no nonsense
coming soon to a pc near you! :cool:
![]() |
Similar Threads
Other Threads in the C Forum
- Previous Thread: confused about shell sort ...
- Next Thread: Color your console text
| Thread Tools | Search this Thread |
#include adobe ansi api array asterisks binarysearch changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic execv feet fgets file fork forloop frequency function getlasterror givemetehcodez global grade graphics gtkgcurlcompiling hacking hardware highest histogram i/o include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue mysql number odf opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scanf segmentationfault sequential shape socket socketprograming standard string systemcall threads turboc unix user voidmain() wab windows.h windowsapi






