使用方法1:
#include <windows.h>
#include <stdio.h>
namespace myfunc{
int func(int a,int b)
{
return a+b;
}
}
using namespace myfunc;
int main(void)
{
int a = 100;
int b = 100;
printf("%d\r\n",func(a,b));
system("pause");
}
使用方法2:
#include <windows.h>
#include <stdio.h>
namespace myfunc{
int func(int a,int b)
{
return a+b;
}
}
int main(void)
{
int a = 100;
int b = 100;
printf("%d\r\n", myfunc::func(a, b));
system("pause");
}