버퍼를 가지는 큐구현
- 최초 등록일
- 2006.10.23
- 최종 저작일
- 2006.01
- C언어
- 가격 1,000원
소개글
int나 char를 이용한 큐가 아닌
버퍼사이즈를 가지고.... 인자로 배열이 넘어왓을떄
배열의 전체를 메모리에 저장하여 큐를 구현..
컴파일 실행환경
vxworks, windows
본문내용
#include "vxWorks.h"
#include "stdio.h"
#include "strLib.h"
#include "logLib.h"
#define MAXSIZE 300
/****************************/
/*Typedefine BUFFER struct. */
/****************************/
typedef struct buf
{
char buffer[1316];
}Buf;
/***************************/
/*Typedefine QUEUE struct. */
/***************************/
typedef struct Queue
{
int length;
int front, rear;
Buf msgbuf[MAXSIZE];
}QUEUE;
/****************************/
/***** Initialize QUEUE *****/
/****************************/
int init_queue(QUEUE *q)
참고 자료
없음