I am writing a program using classes. In the header file I want to declare a 'char' variable as private (lets call the variable 'flag'). Then in the member class function 'print' depending on whether the time is 0 thru 11 or 12 thru 23 ( I am using military time) I want the 'char' variable 'flag' to hold the string either 'AM' or 'PM'.
Once I am in the 'print' function I am not sure how to assign either 'AM' or 'PM' to the char variable. Is it..
flag = "AM" or flag == "AM" or flag == 'AM'.
I have tried several different ways and nothing is working.
Thanks
Once I am in the 'print' function I am not sure how to assign either 'AM' or 'PM' to the char variable. Is it..
flag = "AM" or flag == "AM" or flag == 'AM'.
I have tried several different ways and nothing is working.
Thanks