Click here to Skip to main content
15,891,864 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error C2146 in Visual C++ Pin
Jose Lamas Rios18-Jul-05 7:19
Jose Lamas Rios18-Jul-05 7:19 
GeneralRe: error C2146 in Visual C++ Pin
David Crow18-Jul-05 8:04
David Crow18-Jul-05 8:04 
Generaltransparent printing problem with hp plotter and gdi+ Pin
navajo_2k18-Jul-05 3:15
navajo_2k18-Jul-05 3:15 
GeneralRe: transparent printing problem with hp plotter and gdi+ Pin
Shog918-Jul-05 12:31
sitebuilderShog918-Jul-05 12:31 
GeneralRe: transparent printing problem with hp plotter and gdi+ Pin
navajo_2k19-Jul-05 0:05
navajo_2k19-Jul-05 0:05 
QuestionHow to Take Input from MS flex Grid Pin
Ritu Kwatra18-Jul-05 1:41
Ritu Kwatra18-Jul-05 1:41 
GeneralFILE I/O updating Pin
Halawlaws18-Jul-05 1:27
Halawlaws18-Jul-05 1:27 
GeneralRe: FILE I/O updating Pin
David Crow18-Jul-05 2:43
David Crow18-Jul-05 2:43 
Halawlaws wrote:
i need now to delete the last line in the file and add a new one.

How can i do that without overwriting the old line?


These two requirements contradict each other. Deleting a line and replacing it with another is the same as overwriting.

If the old and new lines are the same length, just use fseek() to position the file pointer to the beginning of the line. Otherwise, you'll need to read each line in the file into a temporary file sans the last line. Write the new line to the temporary file. Close both files. Delete the original file. Rename the temporary file. Make sense?


"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown


GeneralRe: FILE I/O updating Pin
Halawlaws18-Jul-05 3:05
Halawlaws18-Jul-05 3:05 
GeneralRe: FILE I/O updating Pin
David Crow18-Jul-05 3:11
David Crow18-Jul-05 3:11 
GeneralRe: FILE I/O updating Pin
Halawlaws18-Jul-05 4:46
Halawlaws18-Jul-05 4:46 
GeneralGet Application Path Pin
Abd.Eskandari18-Jul-05 1:20
Abd.Eskandari18-Jul-05 1:20 
GeneralRe: Get Application Path Pin
Trollslayer18-Jul-05 1:32
mentorTrollslayer18-Jul-05 1:32 
GeneralRe: Get Application Path Pin
Andrew Kirillov18-Jul-05 1:34
Andrew Kirillov18-Jul-05 1:34 
GeneralRe: Get Application Path Pin
T.T.H.18-Jul-05 23:47
T.T.H.18-Jul-05 23:47 
GeneralRe: Get Application Path Pin
ThatsAlok19-Jan-06 23:01
ThatsAlok19-Jan-06 23:01 
Questionwhat does "close wait" and "fin_wait2" means? Pin
awah18-Jul-05 1:14
awah18-Jul-05 1:14 
Generalspinner control makes dots in number within edit box Pin
T.T.H.18-Jul-05 0:48
T.T.H.18-Jul-05 0:48 
GeneralRe: spinner control makes dots in number within edit box Pin
Jose Lamas Rios18-Jul-05 2:44
Jose Lamas Rios18-Jul-05 2:44 
GeneralRe: spinner control makes dots in number within edit box Pin
David Crow18-Jul-05 2:45
David Crow18-Jul-05 2:45 
Generalthanks! Pin
T.T.H.18-Jul-05 23:44
T.T.H.18-Jul-05 23:44 
GeneralMFC, COM and RTC API Pin
TheVictorious18-Jul-05 0:14
TheVictorious18-Jul-05 0:14 
GeneralCImage filling Pin
Themis17-Jul-05 23:41
Themis17-Jul-05 23:41 
GeneralRe: CImage filling Pin
Christian Graus18-Jul-05 0:17
protectorChristian Graus18-Jul-05 0:17 
GeneralRe: CImage filling Pin
Themis18-Jul-05 0:59
Themis18-Jul-05 0:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.