분류 전체보기101 return; 의 의미 #include int send(){ return; } int main() { printf("return; = %d\n", send()); } 의 결과값을 보면 정수형 쓰레기값을 리턴하게된다. 즉, 리턴값을 지정하지 않고 return;와 같이 하게된다면 쓰레게값을 리턴받게 된다. 2009. 3. 23. [TCP/IP] 초기화하기 #include #include #pragma comment(lib, "wsock32.lib") void main() { SOCKET s; WSADATA wsaData; WSAStartup(WINSOCK_VERSION, &wsaData); puts(wsaData.szDescription); puts(wsaData.szSystemStatus); s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if(closesocket(s)!=0){ WSACleanup(); return; } puts("You can used winsock!"); } 2009. 3. 19. 대각선 이차원 배열 #include #include //#define n 5 #define TRUE 1 #define FALSE 0 int main(void) { int n=10; int i=0, j=0, cnt=1, xcnt=0, ycnt=0; int x=0, y=0, flag=0; char arr[100][100]={0,}; while(1){ arr[y++][x--] = cnt++; if(xn-1){ if(y>n-1){ y=++ycnt, x=n-1; }else{ y=ycnt, x=++xcnt; } } if(cnt == n*n+1) break; } //출력부분 for(i=0; i 2009. 3. 18. C 소스코드 출력하기 2009. 3. 17. 이전 1 ··· 20 21 22 23 24 25 26 다음