#include <stdio.h>
// VC6 版本
#pragma comment(linker, "/SECTION:.text,RWS") // 創建自定義的 shared Section
#pragma data_seg(".text")
int g_iShared = 0x37;
#pragma data_seg()
// int g_iShared __attribute__ ((section(".text"))) = 0x37; // GCC 版本
// int g_iShared = 0x37;
int main()
{
g_iShared = 200;
int iLocal = 300;
printf("%d,0x%p\n",g_iShared,&g_iShared);
printf("%d,0x%p\n",iLocal,&iLocal);
return 0;
}