본문 바로가기

과제모음

네트워크 숫자야구(Server)

반응형

     ▷ 메인부

 #include "BaseBallServer.h" // 헤더파일인클루드

 int main(){

 ReadyBaseBall(); // 소켓생성및연결

PlayBaseBall(); // 야구게임시작

 }

 

▷ 헤더부

#ifndef _BASEBALLSERVER_H_ // 재정의오류방지

#define _BASEBALLSERVER_H_

 

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

#include <WinSock2.h>

 

#define PORT 2600 // 포트번호

 

int ReadyBaseBall(); // 소켓연결

void PlayBaseBall(); // 야구게임

#endif

 

▷ 구현부

반응형