It is beneficial to provide
all the relevant information, when asking on the Forum.
Actually, one could spot the error while gathering the information for the Forum post.
There are at least four ways for program to be "wrong":
1. Compiler sees a syntax error.
2. One does not provide all necessary object code to the linker.
3. The runtime crashes.
4. The runtime produces unexpected results.
Your code made an online compiler say:
17:18: error: no 'T Cal<T>::bigger()' member function declared in class 'Cal<T>'
In function 'int main()':
27:14: error: 'class Cal<int>' has no member named 'bigger' |
Two error messages.
Line 17 has
T Cal<T>::bigger()
Line 27 has
cout<<Cl.bigger()<<endl;
Both messages are due to the same syntax error. In my opinion these messages are clear, but your compiler might use different descriptions. Some syntax errors on some compilers can produce much more cryptic messages.
Therefore, a "tip" is to read what your compiler tells you. If the message is too cryptic, then post it with the code.