Skip to content

Commit c876e10

Browse files
author
MayuriNFC
committed
fix compile error
1 parent c2c4ac7 commit c876e10

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

c/bubblesort/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
PROJECT(BUBBLESORT)
2-
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2+
CMAKE_MINIMUM_REQUIRED(VERSION 2.9)
33
INCLUDE_DIRECTORIES(
44
${CMAKE_BINARY_DIR}/../include
55
)
66
AUX_SOURCE_DIRECTORY(
77
${CMAKE_BINARY_DIR}/../src
8+
DIR_SRC
89
)
910
ADD_EXECUTABLE(
1011
bubblesort
11-
bubblesort.cpp
12+
${DIR_SRC}
1213
)

c/bubblesort/src/bubble.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
#include "bubblesort.h"
1+
#include "../include/bubblesort.h"
22
int main(){
33
int a[] = {1,2,3,4,5,6,7,8,9,10};
4-
bubblesort(a);
4+
int i;
5+
for (i=0;i<sizeof(a)/sizeof(a[0]);i++){
6+
printf("%d\n",a[i]);
7+
}
58
return 0;
69
}
710
int *bubblesort(int *array){
@@ -15,4 +18,5 @@ int *bubblesort(int *array){
1518
}
1619
}
1720
}
21+
return *array;
1822
}

0 commit comments

Comments
 (0)