hello guys ...
i have a problem with my code here
its basically to ask the user to input the time as HH:MM:SS then i calcluate the time as
time=hh+mm/60+ss/3600
so first i used string so i will be able to store ':'..
now how to convert this string into
time=hh+mm/60+ss/3600
with these code the result will still string it shows only simple ...
this is my code
int main()
{
string time;
int ss, mm, hh;
cout<<"\nWhat was your riding time in HH:MM:SS : ";
getline(cin,time);
ss=time[7]+10*time[6];
mm=time[3]+10*time[4];
hh=time[1]+10*time[0];
time=hh+mm/60+ss/3600;
cout<<time;
}