I'm new to programming, however I have not been able to find any answer googling for some hours now to my problem, and decided to try my luck here.
I am simply trying to assign some user input to a string using Xcode on a macbook writing in c++.
I am trying to make a calculator and for that to work I need it to be able to read '(' ')' parentheses from the user, however when I type in parentheses in the debugger terminal in Xcode (I believe its called that) I do not get the correct output/string variable assignment.
Any help would be greatly appreciated.
Tried using other datatypes such as wstring, char with no luck.
#include <string>
#include <iostream>
int main() {
std::string test = "";
while (std::cin >> test) {
std::cout << test << "\n";
}
return 0;
}
Input: 1+(2+2)
Output: 1+()2+2
Comment: The boxes displays some type of question mark symbols, looks like it won't show when pasted here though.
I am simply trying to assign some user input to a string using Xcode on a macbook writing in c++.
I am trying to make a calculator and for that to work I need it to be able to read '(' ')' parentheses from the user, however when I type in parentheses in the debugger terminal in Xcode (I believe its called that) I do not get the correct output/string variable assignment.
Any help would be greatly appreciated.
Tried using other datatypes such as wstring, char with no luck.
#include <string>
#include <iostream>
int main() {
std::string test = "";
while (std::cin >> test) {
std::cout << test << "\n";
}
return 0;
}
Input: 1+(2+2)
Output: 1+()2+2
Comment: The boxes displays some type of question mark symbols, looks like it won't show when pasted here though.