CSE 9B FAQ

Q1: Is there a way I can have get_time() print out two different messages
for the first and second time?
Q1: Is there a way I can have get_time() print out two different messages for the first and second time? A1: Not really. But it does not need to. cout << "Enter first time (hr min sec). "; time1.get_time(); cout << "Enter secound time(hr min sec). "; time2.get_time(); Q1: I'm getting: "p3.C", line 122: Error: Formal argument p of type char* in call to swap(char*, char*) is being passed char. Then later: "p3.C", line 122: Error: Formal argument p of type char* in call to swap(char*, char*) is being passed char**. Lets look at these message one at a time. Also remeber that the header for swap is void swap(char*p,char*q); > CC p3.C > "p3.C", line 122: Error: Formal argument p of type char* in call to swap(char*, > char*) is being passed char. > with: > void sort (char* p1, char* p2, ..... > swap (*p1, *p2); Remeber that *p1 turns this in to the value of p1 or *(char*) -> char So you are giving swap, which wants char*, char > "p3.C", line 122: Error: Formal argument p of type char* in call to swap(char*, > char*) is being passed char**. > void sort (char *p1, char *p2, char *p3, char *p4) > swap (&p1, &p2); Rember that &p1 turns this into a pointer *(char*) -> char** So you are giving swap, which wants char*, char**

HOME || Course Description || Course Outline || Lab Hours || FAQ