Hi all
I'm brand new to this website and I was looking for some help with this program that I have to do.
I have to find a way somehow to convert a string to an int.
I have not learned sstream yet and I don't think I am allowed to use it...so I was wondering if there is any other way.
This is what I want my program to do:
cin >> date;
//example 1/1/2005
cout << date[0] << endl;
//Then I want to take the value of date[0], which is 1 and use that value as an int.
//For example, date[0] = 1 and then use that 1 as an int value to multiply by something else or add, subtract, etc and then get an int value for my final answer.
Thanks
Take care,
Beckie
I'm brand new to this website and I was looking for some help with this program that I have to do.
I have to find a way somehow to convert a string to an int.
I have not learned sstream yet and I don't think I am allowed to use it...so I was wondering if there is any other way.
This is what I want my program to do:
cin >> date;
//example 1/1/2005
cout << date[0] << endl;
//Then I want to take the value of date[0], which is 1 and use that value as an int.
//For example, date[0] = 1 and then use that 1 as an int value to multiply by something else or add, subtract, etc and then get an int value for my final answer.
Thanks
Take care,
Beckie