I have two files Sample.cpp and Main_file.cpp. Sample.cpp has only one namespace n1 which contains the definition of int variable x. I want to print this variable x in my main_file.cpp. How do I go about doing this?
//Sample.cpp_BEGINS
namespace n1
{
int x=10;
}
//Sample.cpp_ENDS
//Main_FILE_BEGINS
void main()
{
print x;
}
//MAIN_FILE_ENDS
Thank you for any help you can provide.
You use the fully qualified name of the variable: