># include
#include
using namespace std;
>void main (void)
int main()
>char *sentencePtr = set;
What is set? Why are you redeclaring sentencePtr?
>sentencePtr--;
Yea, that'll work. NOT!
Try walking to the end of the string, then back:
char *p = sentencePtr;
while ( *p != '\0' )
++p;
while ( p != sentencePtr )
cout.put ( *--p );
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Dont try to print out a void function.
change
cout << Backward(line) << endl;
to[CODE]
Backward(line);
cout << endl;
[CODE]
zyruz
Junior Poster in Training
60 posts since Jun 2005
Reputation Points: 10
Solved Threads: 5
>cin >> line;
You had it right the first time, when you were using getline. cin's >> operator stops reading at whitespace, so line only contains the first word.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401