c
分かっていなかった事が分かったのでコンパイルの工程を復習するために hello.cに依存しているtest.cのコンパイル過程をFreeBSD 9.1 RELEASE で出力してみた。-hello.h-#ifndef HELLO_H#define HELLO_Hint sayHello(void);#endif-hello.c-#include "stdio.h"…
#include typedef int (*EVHND)(int, int);int proc(EVHND evhnd){ printf("Error occured !!\n"); if(evhnd != NULL) evhnd(4,2); return -1;}int evha(int a, int b){ printf("event hundler A %d\n", a-b); return 0;}int evhb(int a,int b){ printf("eve…
恥ずかしながらどうやってるのだろうと気になっていたけどやっと知る事ができたのでメモ 1 #include 2 3 int main(void){ 4 5 printf("error message in %s line: %d\n",__FILE__,__LINE__); 6 7 return 0; 8 }標準出力error message in test.c line: 5
Ubuntu特有の作法でハマったのでメモ まずは、ライブラリの作成hello.h #ifndef HELLO_H#define HELLO_Hvoid sayHello();#endifhello.c #include#include"hello.h"void sayHello(){ printf("Hello!!\n");}そして、共有ライブラリ作成。ここでは、ヘッダーフ…
バイナリデータを扱うようになって意識するようになったのでメモ#include#includeint main(int argc,char **argv){ printf("size of char: %d bit\n",CHAR_BIT); printf(" char range is %d -> %d\n",CHAR_MIN,CHAR_MAX); printf(" signed char range is %d …