如果限定函数只在本cpp内有效

1、static关键字

static void s_funName()
{

  return;
}

2、namespace 不要给命名空间名字这样外部 也调用不了

namespace

{

  void s_funName();

}

猜你喜欢

转载自www.cnblogs.com/likemao/p/10317994.html
今日推荐