自己定義的頭檔案:
#ifndef _CLOCK_H_
#define _CLOCK_H_
struct Time {
int hour;
int munite;
int scecond;
};
void set(Time*p, int h, int m, int s);
void tick(Time*p);
void show(Time*p);
void run(Time*p);
#endif
參考時提示:
#include"clock.h"
無法打開源檔案"clock.h"
uj5u.com熱心網友回復:
Time與系統關鍵字沖突,改一下就行了另外,set也可能會沖突
#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 run(STime *p);
#endif
uj5u.com熱心網友回復:
跟C語言關鍵字應該不沖突,因為我的Time首字母是大寫形式,我現在在前面加了下劃線,依然無法解決這個問題,急!uj5u.com熱心網友回復:
你的頭檔案保存的檔案名是否為 clock.h 并且在cpp檔案同目錄下?uj5u.com熱心網友回復:
你在.c檔案中是如何include包含的?uj5u.com熱心網友回復:
不在include的path中,添加下轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/53490.html
上一篇:關于Python 操作 MySQL ,這才是正確姿勢,你學會了嗎?
下一篇:3d列印
