Hi,
I would like to know were my error(s) are in this program. Could somebody look and help me out? I'm trying to get a string and reverse the order using for loops.
Code:#include <iostream.h> #include<string.h> //void ReverseIt(char [], char []); int main() { char str[50], copy[50]; int i,j,length; length = strlen(str); cout<<"\nEnter a string: "<<endl; cin.getline(str,49); cout<<"\nYou entered " << str <<" !" << endl; for(i=0;i<50;i++) { cout<<"\nYou entered " << str[i] << endl; for(j=0;j>50;j--) { cout<<"\nThe reverse is " << copy[j] <<endl; } } return 0; }



LinkBack URL
About LinkBacks



Have a nice day.