11.3 가위 바위 보 게임 구조
- 최초 등록일
- 2011.11.16
- 최종 저작일
- 2011.10
- 6페이지/ 어도비 PDF
- 가격 1,000원
소개글
소켓프로그래밍 이론
목차
★ 가위 바위 보 게임 구조.
본문내용
★ 가위 바위 보 게임 구조.
1. 파이프 생성.
2. 자식 프로세스 생성.
3. 데이터 입력 (가위 바위 보 선택)
4. 파이프 통해서 데이터 전송(자식-> 부모)
5. 승자 확인 !
6. 결과 전송(부모 -> 자식)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#define BUFSIZE 100
void error_handling(char *message);
int main(int argc, char **argv)
{
int sock;
char message[BUFSIZE];
int str_len;
struct sockaddr_in serv_addr;
if(argc!=3){
printf("Usage : %s <IP> <port>\n", argv[0]);
exit(1);
참고 자료
없음