閱讀988 返回首頁    go 阿裏雲 go 技術社區[雲棲]


c++工程包含測試

1.h文件:

#include <stdio.h>

int myAdd(int a,int b);


test.cpp文件:

int myAdd(int a,int b)
{
	return a+b;
}

2.cpp文件:

#include "1.h"

int main()
{
	int x,y;
 	scanf("%d%d",&x,&y);
 	printf("%d\n",myAdd(x,y));
	
	return 0;
}


可以正常運行a+b的功能。。。

最後更新:2017-04-03 05:39:04

  上一篇:go thinkPHP之微理解
  下一篇:go Java測試包Mockito