#ifndef MY_LIB_H
#define MY_LIB_H
/*構造体の定義やら*/
typedef struct{
int x;
int y;
} xy;
/*関数のプロトタイプ宣言やら*/
int myfunc(int a, int b);
#endif
#include "mylib.h"
int myfunc(int a, int b){
return a + b;
}
#include <stdio.h>
#include "mylib.h"
int main(void){
int a = 3;
int b = 5;
printf("%d\n", myfunc(a, b));
return 0;
}
gcc -c mylib.c
gcc -c main.c
gcc main.o mylib.o -o main.out