{"id":3790,"date":"2020-07-10T12:36:45","date_gmt":"2020-07-10T03:36:45","guid":{"rendered":"https:\/\/now0930.pe.kr\/wordpress\/?p=3790"},"modified":"2020-07-10T12:37:38","modified_gmt":"2020-07-10T03:37:38","slug":"%eb%8d%94%eb%b8%94-%ed%8f%ac%ec%9d%b8%ed%84%b0-%ec%9d%b4%ed%95%b4%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/now0930.pe.kr\/wordpress\/%eb%8d%94%eb%b8%94-%ed%8f%ac%ec%9d%b8%ed%84%b0-%ec%9d%b4%ed%95%b4%ed%95%98%ea%b8%b0\/","title":{"rendered":"c \ub354\ube14 \ud3ec\uc778\ud130 \uc774\ud574\ud558\uae30."},"content":{"rendered":"\n<p>c\ub294 \ud3ec\uc778\ud130\uac00 \ud63c\ub780\uc2a4\ub7ec\uc6b4\ub370 \uc774\ud574\ud588\ub2e4\uace0 \ubbff\uace0???? \ub098\uc911\uc5d0 \ub2e4\uc2dc \uc0dd\uac01\ud558\ub824\uace0 \ub0a8\uae34\ub2e4.<\/p>\n\n\n\n<p>\ub2e4\uc74c \ucf54\ub4dc\ub97c \ub9cc\ub4e4\uc5c8\uace0 \uc2e4\ud328\ud588\ub2e4. bufToStruct\ub97c \uc2e4\ud589\ud560 \ub54c \ud3ec\uc778\ud130\ub85c \ub118\uacbc\uc5b4\ub3c4 buf\ub97c \ubc1b\uc73c\uba74\uc11c \uc784\uc2dc \uacf5\uac04\uc5d0 \ubcc0\uc218\ub97c \ub9cc\ub4e0\ub2e4. \ud568\uc218 \uc2e4\ud589\uc744 \ub05d\ub0b4\uba74\uc11c \uadf8 \uacf5\uac04\ub3c4 \ub0a0\uc544\uac00 \ub3c4\ub85c\ubb35 \ub41c\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include &lt;stdio.h>\n#include \"module1.h\"\nint main()\n{\n    struct mysqlStruct oneSqlData;\n    char readbuf[MAX_LEN];\n    int ret;\n    openfile(readbuf);\n    printf(\"\ubc84\ud37c\ub294 %s\\n\",readbuf);\n    do{ \n        ret=bufToStruct(readbuf, &amp;oneSqlData);\n        printf(\"%p\\n\", readbuf);\n        sleep(1);\n    }while(ret==-1);\n    \/\/bufToStruct(readbuf, &amp;oneSqlData);\n\n    return 0;\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int bufToStruct(char* buf, struct mysqlStruct *sqlData){\n\n\t\/\/buf\ub97c \uc77d\uc5b4 \ub0a0\uc790, \uc2dc\uac01, \uc628\ub3c4\ub85c \ubd84\ub9ac.\n\t\/\/,\ub85c \ubd84\ub9ac\ub418\uc5b4 delimiter\ub85c \ubd84\ub9ac..\n\t\/\/\ud55c\ubc88 \uc77d\uc744\ub54c\ub9c8\ub2e4 buf \ud55c \uc904 \ub0b4\uc6a9\uc744 sqlData\ub85c \uc774\ub3d9.\n\t\/\/\uc131\uacf5\ud558\uba74 0,\n\t\/\/\ub9c8\uc9c0\ub9c9\uc774\uba74 1,\n\t\/\/\uc2e4\ud328\ud558\uba74 -1\uc744 return.\n\n\tsize_t len;\n\tchar* temp;\t\t\/\/\uc2dc\uc791 \uc704\uce58\n\tlen=strlen(buf);\n\tchar tempbuf[len];\t\t\/\/strtok\ub85c \uc791\uc5c5\ud560 \ub0b4\uc6a9. strtok\uc774 \uc6d0\ub798 \ubc84\ud37c\ub97c \uc218\uc815\ud568.\n\tchar *year,*month, *day, *hour, *minute, *temperature;\n\tint year2, month2, day2, hour2, minute2, temperature2;\n\t\/\/strtok\uc774 \uc6d0\ub798 \ubc84\ud37c\ub97c \uc798\ub77c \ubc84\ub824.\n\t\/\/\uc784\uc2dc\ub85c \uce74\ud53c\ud574\uc11c \uc0ac\uc6a9.\n\t\/\/\uc6d0\ub798 \ud3ec\uc778\ud130\ub294 \ud1a0\ud070 \ud06c\uae30\ub9cc\ud07c \ub118\uae40.\n\tstrcpy(tempbuf, buf);\n\n\t\/\/\uccab\uc904\uc744 \uc77d\uc744 \uacbd\uc6b0 \ubb34\uc2dc\ud560 \ubc29\ubc95 \ud544\uc694.\n\t\/\/\uadf8\ub0e5 \ub123\uc5b4\uc11c \uc5d0\ub7ec, \uc815\uc0c1 \ud655\uc778.\n\ttemp = strtok(tempbuf, \"\\n\");\n\n\tlen=strlen(temp);\n\tyear=strtok(temp, \"-\");\n\t\/\/\ubb34\uc2a8 \ub370\uc774\ud130\uc778\uc9c0 \ubaa8\ub974\uaca0\uc9c0\ub9cc, \uc77c\ub2e8 \uc22b\uc790\ub8cc \ubcc0\uacbd.\n\tyear2=atoi(year);\n\n\t\/\/buf \ub0b4\uc6a9 \uc0ad\uc81c..temp \ub9cc\ud07c.\n\t\/\/buf \ud3ec\uc778\ud130\ub97c temp \ub9cc\ud07c \uc774\ub3d9.\n\tfor(int i=0;i&lt;len;i++)\n\t\tbuf++;\n\n\tif(year2 &lt; 2000 || year2 > 2100)\n\t\treturn -1;\n\n\t\/\/\uc815\uc0c1\ub300\ub85c \uc9c4\ud589.\n\tsqlData->year = year2;\n\tprintf(\"year2 is %d\\n\",year2);\n\tmonth=strtok(temp,\"-\");\n\tmonth=strtok(temp,\"-\");\n\tmonth2=atoi(month);\n\tsqlData->month = month2;\n\n\t\n}<\/pre>\n\n\n\n<p>\uc704 \ub0b4\uc6a9\uc744 gdb\ub85c \ud655\uc778\ud574 \ubcf4\uc558\ub2e4.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">(gdb) run\nStarting program: \/home\/pi\/Project\/cCode\/module1\/insertTemperature \n\ubc84\ud37c\ub294 \ub0a0\uc790, \uc628\ub3c4\n2020-7-9 10:00:00, 24.5\n2020-7-9 10:01:00, 24.5\n2020-7-9 10:02:00, 24.5\n2020-7-9 10:03:00, 24.5\n\n\nBreakpoint 1, main () at main.c:11\n11\t\t\tret=bufToStruct(readbuf, &amp;oneSqlData);\n(gdb) display &amp;readbuf\n1: &amp;readbuf = (char (*)[200]) 0xbefff30c\n(gdb) s\nbufToStruct (\n    buf=0xbefff30c \"\ub0a0\uc790, \uc628\ub3c4\\n2020-7-9 10:00:00, 24.5\\n2020-7-9 10:01:00, 24.5\\n2020-7-9 10:02:00, 24.5\\n2020-7-9 10:03:00, 24.5\\n\", sqlData=0xbefff3d4)\n    at module1.c:42\n42\tint bufToStruct(char* buf, struct mysqlStruct *sqlData){\n(gdb) l\n37\t\n38\t\t\/\/ ruturn \uc131\uacf5.\n39\t\treturn 0;\n40\t}\n41\t\n42\tint bufToStruct(char* buf, struct mysqlStruct *sqlData){\n43\t\n44\t\t\/\/buf\ub97c \uc77d\uc5b4 \ub0a0\uc790, \uc2dc\uac01, \uc628\ub3c4\ub85c \ubd84\ub9ac.\n45\t\t\/\/,\ub85c \ubd84\ub9ac\ub418\uc5b4 delimiter\ub85c \ubd84\ub9ac..\n46\t\t\/\/\ud55c\ubc88 \uc77d\uc744\ub54c\ub9c8\ub2e4 buf \ud55c \uc904 \ub0b4\uc6a9\uc744 sqlData\ub85c \uc774\ub3d9.\n(gdb) \n47\t\t\/\/\uc131\uacf5\ud558\uba74 0,\n48\t\t\/\/\ub9c8\uc9c0\ub9c9\uc774\uba74 1,\n49\t\t\/\/\uc2e4\ud328\ud558\uba74 -1\uc744 return.\n50\t\n51\t\tsize_t len;\n52\t\tchar* temp;\t\t\/\/\uc2dc\uc791 \uc704\uce58\n53\t\tlen=strlen(buf);\n54\t\tchar tempbuf[len];\t\t\/\/strtok\ub85c \uc791\uc5c5\ud560 \ub0b4\uc6a9. strtok\uc774 \uc6d0\ub798 \ubc84\ud37c\ub97c \uc218\uc815\ud568.\n55\t\tchar *year,*month, *day, *hour, *minute, *temperature;\n56\t\tint year2, month2, day2, hour2, minute2, temperature2;\n(gdb) display &amp;buf\n2: &amp;buf = (char **) 0xbefff2cc\n(gdb) display buf\n3: buf = 0xbefff30c \"\ub0a0\uc790, \uc628\ub3c4\\n2020-7-9 10:00:00, 24.5\\n2020-7-9 10:01:00, 24.5\\n2020-7-9 10:02:00, 24.5\\n2020-7-9 10:03:00, 24.5\\n\"<\/pre>\n\n\n\n<p>b<s>ufToStruct\ub85c readbuf\ub97c \uc804\ub2ec\ud560 \ub54c \uc8fc\uc18c\ub97c \uc804\ub2ec\ud558\ub294 \uc9c1\uc811 \uc804\ub2ec\ud558\uae38 \uc6d0\ud588\ub2e4. bufToStruct\ub85c \uc804\ub2ec\ud558\ub294 0xbefff2cc\ub294 \uc5b4\ub514\uc5d0\uc11c \ub098\uc654\uc744\uae4c? \uc784\uc2dc \ubcc0\uc218\ub85c \uc790\uae30\uac00 \ub9cc\ub4e4\uc5c8\ub2e4. \uc784\uc2dc\ub85c \ub9cc\ub4e0(\ucf5c \ud558\uace0 \uc5c6\uc5b4\uc9c8) \uc8fc\uc18c\uc5d0 \ud3ec\uc778\ud130 \uac12\uc744 \ub123\uc5c8\ub2e4. \uadf8\ub7ec\ub2c8 \ud568\uc218 \ub0b4\ubd80\uc5d0\uc11c \uc5f4\uc2ec\ud788 \ud3ec\uc778\ud130\ub97c \uc6c0\uc9c1\uc5ec\ub3c4 \uba54\uc778 \ud568\uc218 \ud3ec\uc778\ud130\ub294 \ubcc0\ud558\uc9c0 \uc54a\uc558\ub2e4. &amp;buf = 0xbefff30c\ub85c \ubc14\uafd4\uc57c \ud55c\ub2e4. \uc774\uc911 \ud3ec\uc778\ud130\uac00 \uadf8 \uc5ed\ud560\uc744 \ud55c\ub2e4.<\/s><\/p>\n\n\n\n<p>\ub2e4\uc74c \uadf8\ub9bc\uc744 \ucc38\uc870\ud558\uba74 \uc27d\uac8c?? \uc774\ud574\ud560 \uc218 \uc788\ub2e4. \uc774\uac8c \uba38\ub77c\uace0 \uc0bd\uc9c8\ud558\uace0 \uc788\ub294\uc9c0..<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"1024\" src=\"https:\/\/now0930.pe.kr\/wordpress\/wp-content\/uploads\/2020\/07\/1594351752397-507x1024.jpg\" alt=\"\" class=\"wp-image-3797\" srcset=\"https:\/\/now0930.pe.kr\/wordpress\/wp-content\/uploads\/2020\/07\/1594351752397-507x1024.jpg 507w, https:\/\/now0930.pe.kr\/wordpress\/wp-content\/uploads\/2020\/07\/1594351752397-149x300.jpg 149w, https:\/\/now0930.pe.kr\/wordpress\/wp-content\/uploads\/2020\/07\/1594351752397-768x1551.jpg 768w, https:\/\/now0930.pe.kr\/wordpress\/wp-content\/uploads\/2020\/07\/1594351752397-761x1536.jpg 761w, https:\/\/now0930.pe.kr\/wordpress\/wp-content\/uploads\/2020\/07\/1594351752397.jpg 1000w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include &lt;stdio.h>\n#include \"module1.h\"\nint main()\n{\n\tstruct mysqlStruct oneSqlData;\n\tchar readbuf[MAX_LEN];\n\tchar* readbufPtr;\n\tint ret;\n\topenfile(readbuf);\n\treadbufPtr = readbuf;\n\t\/\/printf(\"\ubc84\ud37c\ub294 %s\\n\",readbufPtr);\n\tdo{\n\t\tret=bufToStruct(&amp;readbufPtr, &amp;oneSqlData);\n\t\tprintf(\"%s\\n\", readbufPtr);\n\t\tsleep(1);\n\t}while(ret==-1);\n\t\/\/bufToStruct(readbuf, &amp;oneSqlData);\n\n\treturn 0;\n}\n<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include &lt;stdio.h>\n#include &lt;unistd.h>\n#include &lt;sys\/types.h>\n#include &lt;sys\/stat.h>\n#include &lt;fcntl.h>\n#include \"module1.h\"\n#include &lt;string.h>\n#include &lt;stdlib.h>\n\nint openfile(char* readbuf){\n\n\n\t\/\/\ud30c\uc77c\uc744 \uc5f4\uc5b4,\n\t\/\/readbuf\ub85c \uae30\ub85d.\n\n\tint fd;\n\t\/\/char buf[MAX_LEN];\n\tstruct stat myfileStat;\n\tfd = open(\".\/temperatureRecord.txt\", O_RDONLY);\n\tif (fd == -1){\n\t\tperror(\"error to open file\\n\");\n\t\treturn -1;\n\t}\n\n\t\/\/\uc77d\uc744 \ud30c\uc77c \ud06c\uae30 \ud655\uc778.\n\tfstat(fd, &amp;myfileStat);\n\t\/\/\ucd5c\ub300 \ubc84\ud37c\ub7c9 \ub300\ube44 \ud30c\uc77c\uc774 \ud070\uc9c0 \ud655\uc778\n\tif(MAX_LEN &lt; myfileStat.st_size){\n\t\tperror(\"file is too big\\n\");\n\t\t\/\/return  \uc2e4\ud328\n\t\treturn -1;\n\t}\n\t\n\tread(fd, readbuf, myfileStat.st_size);\n\t\/\/printf(\"\ubc84\ud37c\ub294 %s\\n\",buf);\n\tclose(fd);\n\n\t\/\/ ruturn \uc131\uacf5.\n\treturn 0;\n}\n\nint bufToStruct(char** buf, struct mysqlStruct *sqlData){\n\n\t\/\/buf\ub97c \uc77d\uc5b4 \ub0a0\uc790, \uc2dc\uac01, \uc628\ub3c4\ub85c \ubd84\ub9ac.\n\t\/\/,\ub85c \ubd84\ub9ac\ub418\uc5b4 delimiter\ub85c \ubd84\ub9ac..\n\t\/\/\ud55c\ubc88 \uc77d\uc744\ub54c\ub9c8\ub2e4 buf \ud55c \uc904 \ub0b4\uc6a9\uc744 sqlData\ub85c \uc774\ub3d9.\n\t\/\/\uc131\uacf5\ud558\uba74 0,\n\t\/\/\ub9c8\uc9c0\ub9c9\uc774\uba74 1,\n\t\/\/\uc2e4\ud328\ud558\uba74 -1\uc744 return.\n\n\tsize_t len, len2;\n\tchar* temp;\t\t\/\/\uc2dc\uc791 \uc704\uce58\n\tlen=strlen(*buf);\n\tchar tempbuf[len];\t\t\/\/strtok\ub85c \uc791\uc5c5\ud560 \ub0b4\uc6a9. strtok\uc774 \uc6d0\ub798 \ubc84\ud37c\ub97c \uc218\uc815\ud568.\n\tchar *year,*month, *day, *hour, *minute, *temperature;\n\tint year2, month2, day2, hour2, minute2, temperature2;\n\t\/\/strtok\uc774 \uc6d0\ub798 \ubc84\ud37c\ub97c \uc798\ub77c \ubc84\ub824.\n\t\/\/\uc784\uc2dc\ub85c \uce74\ud53c\ud574\uc11c \uc0ac\uc6a9.\n\t\/\/\uc6d0\ub798 \ud3ec\uc778\ud130\ub294 \ud1a0\ud070 \ud06c\uae30\ub9cc\ud07c \ub118\uae40.\n\tstrcpy(tempbuf, *buf);\n\n\t\/\/\uccab\uc904\uc744 \uc77d\uc744 \uacbd\uc6b0 \ubb34\uc2dc\ud560 \ubc29\ubc95 \ud544\uc694.\n\t\/\/\uadf8\ub0e5 \ub123\uc5b4\uc11c \uc5d0\ub7ec, \uc815\uc0c1 \ud655\uc778.\n\ttemp = strtok(tempbuf, \"\\n\");\n\n\tlen=strlen(temp);\n\tyear=strtok(temp, \"-\");\n\t\/\/\ubb34\uc2a8 \ub370\uc774\ud130\uc778\uc9c0 \ubaa8\ub974\uaca0\uc9c0\ub9cc, \uc77c\ub2e8 \uc22b\uc790\ub85c \ubcc0\uacbd.\n\tyear2=atoi(year);\n\n\t\/\/buf \ub0b4\uc6a9 \uc0ad\uc81c..temp \ub9cc\ud07c.\n\t\/\/buf \ud3ec\uc778\ud130\ub97c temp \ub9cc\ud07c \uc774\ub3d9.\n\t\/\/printf(\"\ud568\uc218 \ub0b4\ubd80:\ud3ec\uc778\ud130 \uc774\ub3d9 \uc804\\n %s\",*buf);\n\t*buf=*buf+len+strlen(\"\\n\");\n\n\t\/\/printf(\"\ud568\uc218 \ub0b4\ubd80:\ud3ec\uc778\ud130 \uc774\ub3d9 \ud6c4\\n %s\",*buf);\n\n\n\tif(year2 &lt; 2000 || year2 > 2100)\n\t\treturn -1;\n\n\t\/\/\uc815\uc0c1\ub300\ub85c \uc9c4\ud589.\n\tsqlData->year = year2;\n\tprintf(\"year2 is %d\\n\",year2);\n\tmonth=strtok(temp,\"-\");\n\tmonth=strtok(temp,\"-\");\n\tmonth2=atoi(month);\n\tsqlData->month = month2;\n}\n<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Breakpoint 1, main () at main.c:13\n13\t\t\tret=bufToStruct(&amp;readbufPtr, &amp;oneSqlData);\n1: readbufPtr = 0xbefff30c \"\ub0a0\uc790, \uc628\ub3c4\\n2020-7-9 10:00:00, 24.5\\n2020-7-9 10:01:00, 24.5\\n2020-7-9 10:02:00, 24.5\\n2020-7-9 10:03:00, 24.5\\n\"\n2: &amp;readbuf = (char (*)[200]) 0xbefff30c\n3: *readbufPtr = 235 '\\353'\n(gdb) s\nbufToStruct (buf=0xbefff308, sqlData=0xbefff3d4) at module1.c:42\nwarning: Source file is more recent than executable.\n42\tint bufToStruct(char** buf, struct mysqlStruct *sqlData){\n(gdb) display &amp;buf\n4: &amp;buf = (char ***) 0xbefff2d4\n(gdb) display buf\n5: buf = (char **) 0xbefff308\n(gdb) display *buf\n6: *buf = 0xbefff30c \"\ub0a0\uc790, \uc628\ub3c4\\n2020-7-9 10:00:00, 24.5\\n2020-7-9 10:01:00, 24.5\\n2020-7-9 10:02:00, 24.5\\n2020-7-9 10:03:00, 24.5\\n\"\n(gdb) l\n37\t\n38\t\t\/\/ ruturn \uc131\uacf5.\n39\t\treturn 0;\n40\t}\n41\t\n42\tint bufToStruct(char** buf, struct mysqlStruct *sqlData){\n43\t\n44\t\t\/\/buf\ub97c \uc77d\uc5b4 \ub0a0\uc790, \uc2dc\uac01, \uc628\ub3c4\ub85c \ubd84\ub9ac.\n45\t\t\/\/,\ub85c \ubd84\ub9ac\ub418\uc5b4 delimiter\ub85c \ubd84\ub9ac..\n46\t\t\/\/\ud55c\ubc88 \uc77d\uc744\ub54c\ub9c8\ub2e4 buf \ud55c \uc904 \ub0b4\uc6a9\uc744 sqlData\ub85c \uc774\ub3d9.\n(gdb) \n47\t\t\/\/\uc131\uacf5\ud558\uba74 0,\n48\t\t\/\/\ub9c8\uc9c0\ub9c9\uc774\uba74 1,\n49\t\t\/\/\uc2e4\ud328\ud558\uba74 -1\uc744 return.\n50\t\n51\t\tsize_t len, len2;\n52\t\tchar* temp;\t\t\/\/\uc2dc\uc791 \uc704\uce58\n53\t\tlen=strlen(*buf);\n54\t\tchar tempbuf[len];\t\t\/\/strtok\ub85c \uc791\uc5c5\ud560 \ub0b4\uc6a9. strtok\uc774 \uc6d0\ub798 \ubc84\ud37c\ub97c \uc218\uc815\ud568.\n55\t\tchar *year,*month, *day, *hour, *minute, *temperature;\n56\t\tint year2, month2, day2, hour2, minute2, temperature2;\n(gdb) \n57\t\t\/\/strtok\uc774 \uc6d0\ub798 \ubc84\ud37c\ub97c \uc798\ub77c \ubc84\ub824.\n58\t\t\/\/\uc784\uc2dc\ub85c \uce74\ud53c\ud574\uc11c \uc0ac\uc6a9.\n59\t\t\/\/\uc6d0\ub798 \ud3ec\uc778\ud130\ub294 \ud1a0\ud070 \ud06c\uae30\ub9cc\ud07c \ub118\uae40.\n60\t\tstrcpy(tempbuf, *buf);\n61\t\n62\t\t\/\/\uccab\uc904\uc744 \uc77d\uc744 \uacbd\uc6b0 \ubb34\uc2dc\ud560 \ubc29\ubc95 \ud544\uc694.\n63\t\t\/\/\uadf8\ub0e5 \ub123\uc5b4\uc11c \uc5d0\ub7ec, \uc815\uc0c1 \ud655\uc778.\n64\t\ttemp = strtok(tempbuf, \"\\n\");\n65\t\n66\t\tlen=strlen(temp);\n(gdb) \n67\t\tyear=strtok(temp, \"-\");\n68\t\t\/\/\ubb34\uc2a8 \ub370\uc774\ud130\uc778\uc9c0 \ubaa8\ub974\uaca0\uc9c0\ub9cc, \uc77c\ub2e8 \uc22b\uc790\ub85c \ubcc0\uacbd.\n69\t\tyear2=atoi(year);\n70\t\n71\t\t\/\/buf \ub0b4\uc6a9 \uc0ad\uc81c..temp \ub9cc\ud07c.\n72\t\t\/\/buf \ud3ec\uc778\ud130\ub97c temp \ub9cc\ud07c \uc774\ub3d9.\n73\t\t\/\/printf(\"\ud568\uc218 \ub0b4\ubd80:\ud3ec\uc778\ud130 \uc774\ub3d9 \uc804\\n %s\",*buf);\n74\t\t*buf=*buf+len+strlen(\"\\n\");\n75\t\n76\t\t\/\/printf(\"\ud568\uc218 \ub0b4\ubd80:\ud3ec\uc778\ud130 \uc774\ub3d9 \ud6c4\\n %s\",*buf);\n(gdb) b 74\nBreakpoint 3 at 0x10814: file module1.c, line 74.\n(gdb) n\n53\t\tlen=strlen(*buf);\n4: &amp;buf = (char ***) 0xbefff2d4\n5: buf = (char **) 0xbefff308\n6: *buf = 0xbefff30c \"\ub0a0\uc790, \uc628\ub3c4\\n2020-7-9 10:00:00, 24.5\\n2020-7-9 10:01:00, 24.5\\n2020-7-9 10:02:00, 24.5\\n2020-7-9 10:03:00, 24.5\\n\"\n(gdb) c\nContinuing.\n\nBreakpoint 3, bufToStruct (buf=0xbefff308, sqlData=0xbefff3d4) at module1.c:74\n74\t\t*buf=*buf+len+strlen(\"\\n\");\n4: &amp;buf = (char ***) 0xbefff2d4\n5: buf = (char **) 0xbefff308\n6: *buf = 0xbefff30c \"\ub0a0\uc790, \uc628\ub3c4\\n2020-7-9 10:00:00, 24.5\\n2020-7-9 10:01:00, 24.5\\n2020-7-9 10:02:00, 24.5\\n2020-7-9 10:03:00, 24.5\\n\"\n(gdb) n\n79\t\tif(year2 &lt; 2000 || year2 > 2100)\n4: &amp;buf = (char ***) 0xbefff2d4\n5: buf = (char **) 0xbefff308\n6: *buf = 0xbefff31b \"2020-7-9 10:00:00, 24.5\\n2020-7-9 10:01:00, 24.5\\n2020-7-9 10:02:00, 24.5\\n2020-7-9 10:03:00, 24.5\\n\"\n(gdb) \n<\/pre>\n\n\n\n<p>\uc544\ub798 \uc0ac\uc774\ud2b8\ub97c \ucc3e\uc544 \ubd24\ub294\ub370, \uc798 \uc774\ud574\uac00 \uc548\ub41c\ub2e4. \ub514\ubc84\uac70\ub85c \uc8fc\uc18c \ud655\uc778\ud558\ub294\uac8c \uac00\uc7a5 \ud655\uc2e4\ud588\ub2e4. \u3160\u3160. \ubcc4 \ub0b4\uc6a9\ub3c4 \uc5c6\ub294\ub370, \uc65c\ucf00 \uc624\ub798\uac78\ub9ac\ub294\uc9c0&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/www.geeksforgeeks.org\/double-pointer-pointer-pointer-c\/\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/stackoverflow.com\/questions\/766893\/how-do-i-modify-a-pointer-that-has-been-passed-into-a-function-in-c\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Unit 63.3 \uc774\uc911 \ud3ec\uc778\ud130 \ub9e4\uac1c\ubcc0\uc218 \uc0ac\uc6a9\ud558\uae30\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/NKWDx5wezMs?list=PLa9dKeCAyr7jsbboqbsSnsTIVds0Dl3Ec\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/chanywa.com\/343\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>c\ub294 \ud3ec\uc778\ud130\uac00 \ud63c\ub780\uc2a4\ub7ec\uc6b4\ub370 \uc774\ud574\ud588\ub2e4\uace0 \ubbff\uace0???? \ub098\uc911\uc5d0 \ub2e4\uc2dc \uc0dd\uac01\ud558\ub824\uace0 \ub0a8\uae34\ub2e4. \ub2e4\uc74c \ucf54\ub4dc\ub97c \ub9cc\ub4e4\uc5c8\uace0 \uc2e4\ud328\ud588\ub2e4. bufToStruct\ub97c \uc2e4\ud589\ud560 \ub54c \ud3ec\uc778\ud130\ub85c \ub118\uacbc\uc5b4\ub3c4 buf\ub97c \ubc1b\uc73c\uba74\uc11c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[775,53,776],"class_list":["post-3790","post","type-post","status-publish","format-standard","hentry","category-12","tag-c","tag-linux","tag-system-program"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/comments?post=3790"}],"version-history":[{"count":7,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3790\/revisions"}],"predecessor-version":[{"id":3801,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/posts\/3790\/revisions\/3801"}],"wp:attachment":[{"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/media?parent=3790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/categories?post=3790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/now0930.pe.kr\/wordpress\/wp-json\/wp\/v2\/tags?post=3790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}