Hello! I'm really new to using atoi and I've only really used it as shown below:
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
#include <cstdlib>
usingnamespace std;
int main(int argc, char** argv){
float r = atoi(argv[1]);
float i = atoi(argv[2]);
cout << "The first input is " << r << " and the second is " << i << endl;
}
I compile it and then run it with: ./"test" 2 5
and that would output "The first input is 2 and the second is 5"
If I wanted to have a string display, saying something like "Please enter the first number: " and THEN have the user input a number, how would I go about doing that using atoi?