i have this code with me and i just typed it down in normal c++ syntax, well most of it.. and i want to convert it into the console syntax.. i dont have the software installed on this system to help me through..so, if anyone could convert the following RPN calculator code in console.. please.. i'd really appreciate it..
int main( )
{
stack <char> oprtr; //stack for operators
stack <double> oprnd; //stack for operands
string input;
cout << “Enter an infix expression: “ ;
getline (cin,input) ;
istringstream in (input);
char c;
while (in >> c)
{
if (c = = ‘+’ | | c = = ‘-’ | | c = = ‘*’ | | c = = ‘/’) op.push(c);
else if (c = = ‘)’ )
cout << op.top( ) << “ “ ;
op.pop( );
}
else if (c > = ‘0’ && c < = ‘9’)
{
in.putback (c);
int n;
in >> n;
cout << n << “ “ ;
}
}
okay.. so, how do i do it? i don't have c# on my system either.. it was a task given to us which, we were supposed to do in GUI.. and since i dont know how to use GUI and the FACT that i don't have it on my system either.. i just typed the code in plain c++ syntax.. my other group member was supposed to convert my *console thing* into GUI,since he got the hang of gui.. :/
all i want to do is to convert the code using console::writeline and console::getline where ever its required but i have nooo idea how to go about it.. what should i do?oh ,and we weren't even taught how to work in c#.. :( annoying task!
please guide me a little..... i could get a low score than no score at all..
Helios is a very active and very helpful member here, and he knows a lot of stuff. If you want help with C# code, go find a C# forum, and don't get demanding when people don't respond too helpfully on a C and C++ forum.
It also looks to me like you should go and ask your professor for some help. He cannot require of you something as advanced as GUI programming if you have never been taught how to do it. Otherwise go talk to the department chair.
We aren't going to do all your schoolwork for you.
To be fair to the OP, it was kbw that said is would be probably best done with C#.
Yes the forum (general) is C and C++, but also C++/CLI (for .net in the Windows section) but the OP sounds very confused about the whole thing anyway, what are they teaching these days…