c++ - how to implement a queue of char array -


i want use container of stl use buffer, defined this:

typedef queue<char*> charqueue; 

then

charqueue p; 

then did operations like:

p.push("mouse"); p.push("horse"); 

but want queue of char array of 256 bytes in order hold data. can define this:

typedef unsigned char newtype[256] queue<newtype> newqueue; 

i'm using unsigned char in order hold data don't want change. put in buffer , retrieve again.

otherwise if has implementation i'll thankful.

for queue of raw data things, define

typedef unsigned char byte; typedef std::vector<byte> bytevector; typedef std::queue< bytevector > dataqueue; 

for queue of character strings, std::queue< std::string > others have suggested fine

by way, all_uppercase_names best reserved macros

cheers & hth.,


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -