Right now i read Stephen Prata's book about C++, and learning about extern keyword and its usage. So i have a question. Can i type "extern int var a;" without including a file that defines and initializes this 'a' variable?
#include <iostream>
//#include "vars.h" Not including the file with 'a' variable
using namespace std;
extern int a;
int main()
{
cout << a << endl;
return 0;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…