I'm doing a a program that converts time from 24 hours to 12 hours . I'm doing it using the constructor in class time 12 taking one argument which is of type class time 24 and making the conversion . I've got an error and I don't know where is the problem. Here is the constructor where the error occurs .
time12::time12(time24 t24)
{
int hrs24=t24.getHrs();
pm = t24.getHrs()<12?false :true; //find am / pm
// round seconds
min= t24.getSecs()<30? t24.getMins() :t24.getMins+1;
if(min==60) //carry mins
{
min=0;
++hrs24;
if(hrs24==12 || hrs24==24) //carry hrs
pm=(pm==true)?false : true; //toggle am/pm
}
hrs=(hrs24<13)?hrs24:hrs24-12;
if(hrs==0) //o to 12 a.m
{hrs=12;pm=false;}
}
there are two errors are for
min= t24.getSecs()<30? t24.getMins() :t24.getMins+1;
1)Error 1 error C3867: 'time24::getMins': function call missing argument list; use '&time24::getMins' to create a pointer to member c:\users\reem mandour\documents\visual studio 2008\projects\training5\training5\training5.cpp 113
2)Error 2 error C2296: '+' : illegal, left operand has type 'int (__thiscall time24:: * )(void) const' c:\users\reem mandour\documents\visual studio 2008\projects\training5\training5\training5.cpp 113
thank you
:)