const char* const gmsg = "ABC_DEF_GHI_JKL_XYZ";
void testfunc1();
void testfunc2();
#include <iostream>
#include "header.h"
void testfunc1()
{
std::cout << "msg from testfunc1:" << gmsg << '\n';
}
int main()
{
testfunc1();
testfunc2();
return 0;
}
#include<iostream>
#include "header.h"
void testfunc2()
{
std::cout << "msg from testfunc2:" << gmsg << '\n';
}
extern const char* const gmsg;
void testfunc1();
void testfunc2();
#include <iostream>
#include "header.h"
const char* const gmsg = "ABC_DEF_GHI_JKL_XYZ";
void testfunc1()
{
std::cout << "msg from testfunc1:" << gmsg << '\n';
}
int main()
{
testfunc1();
testfunc2();
return 0;
}
#include<iostream>
#include "header.h"
void testfunc2()
{
std::cout << "msg from testfunc2:" << gmsg << '\n';
}
没有评论:
发表评论