0
I need help plz
The user should enter data in a linked list and he must enter a number to stop the loop I tried to make it 000 but it's read like 0 what should i do
5 Antworten
+ 2
The structure should be something like this:
string number = get input();
if(number == “000”){
quit();
}
else {
int n = stoi(number);
//Rest of your code
}
+ 2
You could ask for a string and it the string is “000” you stop
+ 2
I don’t know C, but in my C++ class I would always take my numbers as strings and convert them to numbers using stoi (After I checked to ensure no characters were provided). If you want to get 000 rather than 0 I would try to do something like that
+ 1
Ok thank you i will try it
0
So i take as input a string and to store data I use the function atoi??