main cpp file
int age;
int main(int argc, char* argv[])
{
printf("%d", age);
return 0;
}
testing cpp file
// global variable
int age = 20;
I have 2 cpp files (1 is main cpp file, 2nd is testing cpp file)
So I'm trying to print out a global variable (integer) from the testing cpp file in main cpp file. It's for simple linker testing. But when I do so I get an error saying there "one or more multiply defined symbols found ".
I have tried using "char" variable and that worked fine but i dont understand why "int" doesnt work