Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to you add a string to the end of a line in a text file? 1

Status
Not open for further replies.

desmondkenny

Programmer
Feb 26, 2002
6
0
0
IE
I know this is probably easy, but at the moment I'm trying to append from one text file to another in a loop and I just haven't got it right.

any relatively easy algrithms in c?

I need to add a string to the end of a line in a text file....NOT to the end of a file.

Thanks,

Des.
 
adding string is a easy job. lets say u have two strings Source[101] and Dest[501].

Dest[] containg say "Tek-Tips is a good forum "
u wish to add Source[] which contains say

Source[] "I want to join it".

u can use strcat(Dest, Source);

the problem what i forsee is that u may want to append the text in the file. uwill have to either use pointers or in case of a fixed length record use the function "puts/fputs" or any other variant.


try this option

[censored] #-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top