<<Sorry about any confusion getting rid of the double post to both the C and C++ boards, merging replies (in the C thread), and moving this to a single thread on the C++ board.>>
<<Sorry about any confusion getting rid of the double post to both the C and C++ boards, merging replies (in the C thread), and moving this to a single thread on the C++ board.>>
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
do i do some sort of loop or if? I really have no idea!! and i think it shows!!
Are you guaranteed that the replacement text will be no bigger than the find text? If not, it would seem that you may need to venture towards dynamic allocation. Well, unless you've got a "large enough" buffer to contain any possible text after replacement. Is it safe to make that assumption?
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
no, the word i have to find is 'be' and the word i have to replace is 'there'. So they are not the same size.
So... are you familiar with dynamic allocation? Or do you have the "large enough" assumption?
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
i have not heard of that...so iguess i would have to go with the 'large enough' assumption...what ever that is!!
please dont abandon me now! How do i do the find and replace stuff?
*sigh* I love it when students are taught how to overflow buffers.
Find text with strstr.
Copy text with strcpy or memcpy.
Move the remaining text with memmove.
Lather, rinse, repeat (if necessary).
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
ok...so how do i code that