0
中大寫和小寫字母,當我使用了「距離」和「時間」作爲標識符名稱爲我的結構,我得到的錯誤。編譯器說,提到的「距離」是不明確的。差異使用結構
#include <iostream>
using namespace std;
struct distance{
float feet;
float inches;
};
struct time {
int hrs;
int mins;
int secs;
};
int main()
{
struct tour {
distance d;
time t;
};
return 0;
}
但是當我使用大寫字母, 「距離」 和 「時間」,
#include <iostream>
using namespace std;
struct Distance{
float feet;
float inches;
};
struct Time {
int hrs;
int mins;
int secs;
};
int main()
{
struct tour {
Distance d;
Time t;
};
return 0;
}
編譯器不顯示任何錯誤。有人能告訴我原因嗎?