commit all code

This commit is contained in:
Changkun Ou
2016-08-20 13:00:44 +08:00
parent 9fd731448b
commit 75b6a4750e
33 changed files with 1294 additions and 2 deletions

13
1/1.1.cpp Normal file
View File

@@ -0,0 +1,13 @@
//
// 1.1.cpp
// c++1x tutorial
//
// created by changkun at shiyanlou.com
//
#include "foo.h"
int main() {
add(1, 2);
return 0;
}

6
1/Makefile Normal file
View File

@@ -0,0 +1,6 @@
TARGET = 1.1
all:
gcc -c foo.c
g++ 1.1.cpp foo.o -o $(TARGET)
clean:
rm -rf *.o $(TARGET)

13
1/foo.c Normal file
View File

@@ -0,0 +1,13 @@
//
// foo.c
// c++1x tutorial
//
// created by changkun at shiyanlou.com
//
#include "foo.h"
int add(int x, int y) {
return x+y;
}

17
1/foo.h Normal file
View File

@@ -0,0 +1,17 @@
//
// foo.h
// c++1x tutorial
//
// created by changkun at shiyanlou.com
//
#ifdef __cplusplus
extern "C" {
#endif
int add(int x, int y);
#ifdef __cplusplus
}
#endif