Skip to content

Commit c2c4ac7

Browse files
author
MayuriNFC
committed
new file: c/bubblesort/CMakeLists.txt
new file: c/bubblesort/include/bubblesort.h new file: c/bubblesort/src/bubble.c new file: cpp/websocket/CMakeLists.txt new file: cpp/websocket/build.sh new file: cpp/websocket/include/websocket.h new file: cpp/websocket/src/websocket.c
1 parent 698faa2 commit c2c4ac7

File tree

7 files changed

+48
-0
lines changed

7 files changed

+48
-0
lines changed

c/bubblesort/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
PROJECT(BUBBLESORT)
2+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
3+
INCLUDE_DIRECTORIES(
4+
${CMAKE_BINARY_DIR}/../include
5+
)
6+
AUX_SOURCE_DIRECTORY(
7+
${CMAKE_BINARY_DIR}/../src
8+
)
9+
ADD_EXECUTABLE(
10+
bubblesort
11+
bubblesort.cpp
12+
)

c/bubblesort/include/bubblesort.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _bubblessort_h
2+
#define _bubblessort_h
3+
#include <stdio.h>
4+
#include <stdlib.h>
5+
int *bubblesort(int *array);
6+
#endif

c/bubblesort/src/bubble.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "bubblesort.h"
2+
int main(){
3+
int a[] = {1,2,3,4,5,6,7,8,9,10};
4+
bubblesort(a);
5+
return 0;
6+
}
7+
int *bubblesort(int *array){
8+
int i,j,temp;
9+
for (i=0;i<sizeof(array)/sizeof(array[0]);i++){
10+
for (j=0;j<sizeof(array)/sizeof(array[0])-i-1;j++){
11+
if (array[j]>array[j+1]){
12+
temp =array[j];
13+
array[j]=array[j+1];
14+
array[j+1]=temp;
15+
}
16+
}
17+
}
18+
}

cpp/websocket/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 2.9)
2+
PROJECT(WEBSOCKET_CPP)
3+
INCLUDE_DIRECTORIES(./include)
4+
AUX_SOURCE_DIRECTORY(./src DIR_SRC)
5+
ADD_EXECUTABLE(./bin ${DIR_SRC})

cpp/websocket/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
rm -rf build
3+
mkdir build
4+
cd build
5+
cmake .. -G "MinGW Makefiles"
6+
make
7+
./bin

cpp/websocket/include/websocket.h

Whitespace-only changes.

cpp/websocket/src/websocket.c

Whitespace-only changes.

0 commit comments

Comments
 (0)