C++
Posted: 11 Jul 2005, 14:40
i'm puzzled.
ok so, i have a file, text type.
actually it's a type of list.. here i'll give u an expample..
dudes
1,3,4,
more dudes
2,5,6,
a list of ppl grouped to groups.
my problem has to do with adding ppl, numbers, to these lists
dudes
1,3,4,7,
more dudes
2,5,6,
so, i try to do this without rewriting the whole file. i just can't do this, is there any way?
if i can't my solution would be to read the file into a buffer to the point where the dude needs to be added, in this case
"dudes
1,3,4,"
add to the buffer
"7,"
add the rest of the file to the buffer
"
more dudes
2,5,6
"
and then use ios::trunc to write the file anew..
ok so, i have a file, text type.
actually it's a type of list.. here i'll give u an expample..
dudes
1,3,4,
more dudes
2,5,6,
a list of ppl grouped to groups.
my problem has to do with adding ppl, numbers, to these lists
dudes
1,3,4,7,
more dudes
2,5,6,
so, i try to do this without rewriting the whole file. i just can't do this, is there any way?
if i can't my solution would be to read the file into a buffer to the point where the dude needs to be added, in this case
"dudes
1,3,4,"
add to the buffer
"7,"
add the rest of the file to the buffer
"
more dudes
2,5,6
"
and then use ios::trunc to write the file anew..