C language prompts that multiple definition of displayPC thinks it is a repeated definition, the actual reason is that the variable cannot be initialized in the header file

 
Define the variable temp in the ah header file and initialize it, that is, explicit initialization. int temp = 0;

The ah header file is included in the ac bc file, and the error of multiple definition of `temp' will appear when compiling.

 

Guess you like

Origin blog.csdn.net/chenhao0568/article/details/106844039