일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- ubuntu
- Spain
- comic agile
- Linux
- program
- Programming
- Book
- France
- QT
- Book review
- programming_book
- django
- leadership
- Java
- hbase
- Malaysia
- Italy
- Kuala Lumpur
- history
- psychology
- agile
- MySQL
- Python
- erlang
- web
- management
- RFID
- hadoop
- Software Engineering
- UK
- Today
- Total
목록Programming/C (13)
//http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/C/Documents/Tip#s-2 #include void main() { const inti=3; //i=4;//compile error int*p=(int*)&i; printf("%d\t%d\n", i, *p); *p=4; printf("%d\t%d\n", i, *p); const intci1=4, ci2=8; //canNOT change value, can change the address const int*cip=&ci1; printf("%d\t%d\t%d\n", ci1, ci2, *cip); cip=&ci2; //*cip=0;//compile error printf("%d\t%d\t%d\n", ..
출처: http://www.joinc.co.kr/modules/moniwiki/wiki.php/Code/C/Scandir ------------------ no sort 10BSize 8192BValue 8192BSize 10A 10BValue 8192A 1048576BValue 1048576A 524288BSize 524288A 524288BValue 1048576BSize ------------------ alphasort 1048576A 1048576BSize 1048576BValue 10A 10BSize 10BValue 524288A 524288BSize 524288BValue 8192A 8192BSize 8192BValue ------------------ versionsort 10A 10BSi..
java의 Atomic* 같은 타입이 당연히 없으므로, thread마다 각각 할당해서 넘겨줬음 #include #include #include #include pthread_tthreads[5]; intdone[5]; void* thread_main(void*); typedef struct { intm_iThreadNum; charm_cChar; long**m_pplValues; }ThreadArg; //http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Thread/Beginning/Example_pthread //gcc -o pthread1 pthread1.c -lpthread int main(void) { inti, j, k, rc, status; Thr..
//pthread1.c #include #include #include pthread_tthreads[5]; intdone[5]; void* thread_main(void*); //http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Thread/Beginning/PthreadApiReference //http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/Thread/Beginning/Example_pthread //gcc -o pthread1 pthread1.c -lpthread int main(void) { inti, rc, status; printf("pid = %d\n", getpid()); for ( i = 0..
http://www.gnu.org/s/libc/manual/html_node/Hash-Search-Function.html http://forum.falinux.com/zbxe/?mid=C_LIB&page=7&document_srl=408331
getdate http://www.xnet.fi/susv3/functions/getdate.html http://old.nabble.com/getdate%283%29---format-date-td6441921.html http://www.kernel.org/doc/man-pages/online/pages/man3/getdate.3.html http://publib.boulder.ibm.com/infocenter/zos/v1r10/index.jsp?topic=/com.ibm.zos.r10.bpxbd00/rgdate.htm #define _GNU_SOURCE 500 #include #include #include int main(int argc, char *argv[]) { struct tm *tmp; in..
원본: http://mwultong.blogspot.com/2006/10/c-string-replace-all.html #include #include #include char *replaceAll(char *s, const char *olds, const char *news); void main(void){ char s[] = "봉숭아 학당! 봉숭아 학당! 봉숭아 학당! 봉숭아 학당!"; char *s2; printf("원본: %s\n", s); s2 = replaceAll(s, "봉숭아", "맹구"); // 에러가 있으면 NULL 을 리턴. 에러가 없으면 결과 출력 (s2 != NULL) ? printf("치환: %s\n", s2) : fputs("Replace String Error...\n", s..
gcc 3.4.5 (mingw), Windows XP #include // define to get CRC32 value #define POLYNOMIAL_FOR_CRC32 (unsigned long)0xedb88320 // use in function makeCRCTable() #define SIZE_OF_CRC32_TABLE 256 static unsigned long l_ulCRCtable[SIZE_OF_CRC32_TABLE]; #include "crc.h" /** CRC32 를 얻기위한 CRC 테이블을 작성한다(Make CRC table to get CRC32 value). getCRC32() 에 의하여 사용되어지고, 사용자가 직접 사용하지는 않는다 (Called by function getCRC..
gcc 3.4.5 (mingw), Windows XP #include /* reserved C marco __FILE__, __LINE__, __DATE__, __TIME__ */ int main() { printf("file name :\t%s\n", __FILE__); printf("line number :\t%d\n", __LINE__); printf("date :\t%s\n", __DATE__); printf("time :\t%s\n", __TIME__); return 0; }
gcc 3.4.5 (mingw), Windows XP /* 마소 주니어 2004.02 page 28 명령행 인자를 주어 menu를 선택하는 경우 */ #include #include void doHello() { printf("command was HELLO\n"); } void doJiny() { printf("command was JINY\n"); } void doNone() { printf("command was NONE\n"); } void doCmd(const char* p_cpCmd) { if ( strcmp(p_cpCmd, "hello") == 0 ) { doHello(); } else if ( strcmp(p_cpCmd, "jiny") == 0 ) { doJiny(); } else { do..