Home > Back-end >  Help: define your own header files can't use - online, etc
Help: define your own header files can't use - online, etc

Time:09-20

Define your own header file:
# # ifndef _CLOCK_H_
# define _CLOCK_H_

Struct Time {
Int hour;
Int munite;
Int scecond;
};
Void the set (Time * p, int h, int m, int s);
Void tick (Time * p);
Void show Time * (p);
Void the run Time * (p);

# endif


Reference:
H # include "clock."
Unable to open source file "clock. H"

CodePudding user response:

Time keyword conflict with the system, we have to do is change

In addition, the set also may conflict

 # # ifndef _CLOCK_H_ 
# define _CLOCK_H_

Struct STime
{
Int hour;
Int munite;
Int scecond;
};

Void Myset (STime * p, int h, int m, int s);
Void tick (STime * p);
Void show (STime * p);
Void the run (STime * p);

# endif

CodePudding user response:

Keyword should not conflict with the C language, because my Time first letter is capitalized, I now in front of the underline, still can't solve this problem, be urgent!

CodePudding user response:

Your head file filename for clock. H and with the CPP file directory?

CodePudding user response:

refer to the second floor response: I am your subject
keyword should not conflict with the C language, because my Time first letter is capitalized, I now in front of the underline, still can't solve this problem, be urgent!
you. C how the include file contains?

CodePudding user response:

Not in the path of the include, add