im having a little trouble with this
reverse program can anyone tell me where i went wrong? -_-"
im a new IT student it would help me a lot if anyone can tell my error . .
Holy shit who's teaching you C++? The man should be fired.
1 2
#include<iostream.h>
#include<string.h>
should be
1 2
#include<iostream>
#include<string>
main()
should be
int main()
Also you either need usingnamespace std; after your includes or put a std:: before all identifiers from the standard library.
As to your specific problem - this should probably be
rev_str(str+1);
But C strings are the devil anyways. We have std::strings for that. Also, put {} braces around your two statements, else you will cout the \0 character as well - that probably won't break anything, but that's not a printable character anyways.