VERY strange problem using the function gets()
> >cout << "Sentence1";
> >cout << "Sentence2";
> there is nothing strange here. You simply cant mix
> iostream and C I/O calls... choose one.
You can, actually...there's a function that will sync the two...I'm not sure
it's necessary here though, since he's using iostreams for standard out and
C streams for standard in; I'm not sure if that counts as mixing. Also, you
may need to flush cout to get Sentence1 to appear, as it may be buffered.
However, in addition to what everyone else has said, I strongly recommend
avoiding gets...it's a buffer overflow waiting to happen. If you must have
gets behavior, use fgets(buf,size,stdin), which at least lets you specify
the size of your buffer, as to avoid overflowing it. gets will happily
write all over your stack.