# Include <iostream> using namespace STD; class time {public: Time (INT, Int, INT); int hour; int min; int sec; void get_time ();}; time: Time (int h, int M, int s) {hour = H; min = m; sec = s;} void time: get_time () {cout
Problem:
Question 1: Why is an error reported when cout <P2 <Endl; is changed to cout <* P2 <Endl?
Question 2: cout <P3 <Endl; why is the value of P3 1? Is the memory address of the Public member function get_time () 1? Even 1 should be written in hexadecimal 000001 format.
Answer:
Problem 1: The out-of-class pair <is not overloaded, so * P2 (T1) cannot be output;
Question 2: Because the obtained address is of the void (A: *) () type, it is not a common pointer. Then use cout to output this type. cout may be used as a bool output directly.
Because cout <can accept so many types rely on heavy load, but it certainly does not have a void (A: *) () type overload
But try to use printf () to output and view the address.
After C ++, nothing else will be default.
C89 can be used without writing function return values or variable types. The default value is int.