Hello, I am trying to put finishing touches on a program I have been working on. I stopped messing with it awhile ago and decided to return and polish it a little.
Oh yeah, I am trying to make it so when it returns the 5 long number (or word actually lol) that it does it and makes it smoother looking. For example 123 would return (weird symbol)(weird symbol)321, but I want it to just be 321. and instead of say (K)(K)321 it would return 321(empty)(empty)
Here is the actual code I have been working on.
#include <iostream>
#include <conio.h>
#include <string>
#include <sstream>
using namespace std;
char n0,n1,n2,n3,n4;
string mystr;
int main ()
{
string mystr;
cout << "Please enter an interger value up to "
"the length of five numbers: " << endl;
getline (cin,mystr);
n0 = mystr[0];
n1 = mystr[1];
n2 = mystr[2];
n3 = mystr[3];
n4 = mystr[4];
if ({ n4 = &0;
cout << n3;
cout << n2;
cout << n1;
cout << n0;)
}
if ({ n4 + n3 = &0;
cout << n2;
cout << n1;
cout << n0;)
}
if ({ n4 + n3 + n2 = &0;
cout << n1;
cout << n0;)
}
if ({ n4 + n3 + n2 + n1 = &0;
cout << n0;)
}
else
cout << n4;
cout << n3;
cout << n2;
cout << n1;
cout << n0;
_getch();
return 0;
}
The error is as follows: In function `int main()':
Line 23 expected primary function before '{' token
Line 23 expected ')' before '{' token
It gives me an error about the if functions, I really want to get them to work in about the same way I have coded, because that is what I am most familiar with. Any help will be appreciated and thanks for your time.
P.S. I didn't have those parenthesis in the first draft I had, It gave me less errors so I assumed it was more correct, please correct me if i'm wrong.