2009年5月3日日曜日

WindowsXPをリモート起動

http://www.blackhair.biz/wiki.cgi?page=WindowsXP%A4%F2%A5%EA%A5%E2%A1%BC%A5%C8%B5%AF%C6%B0

CentOSでWakeOnLan使ってみる
http://rutake.ddo.jp/blog/techmemo/2008/09/centoswakeonlan.html

C:関数ポインタ

#include <stdio.h>

void func(char *);
void test(void (*)(char *) );
int main() {

test(func);
return 0;
}

void func(char *str) {
printf("%s",str);
}
void test(void (*fc)(char *)) {
(*fc)("testfunc\n");
}

2009年4月25日土曜日

C:ビットのonとoff

tmpのionまたはioffビットをonまたはoffする

int biton(int tmp,int ion){
tmp = tmp | (1 << ion);
return tmp;
}

int bitoff(int tmp,int ioff){
tmp = tmp & ~(1 << ioff);
return tmp;
}

C:10進数を2進数で表示2

32ビット表示
int number = 10;
int i;

for(i = 31;i>=0;i--){
printf("%c",((number >> i) & 1 ) + '0');
}

printf("\n\n");