Jag har en class som ser ut så här:
Kod: Markera allt
class Circ_buf{
char b_buf[];
unsigned int b_pos;
unsigned int b_sta; // where is zero?
unsigned int b_size;
public:
Circ_buf(int llength);
bool buff_get(char *new_loc); // Memcpy the data to a new location
bool buff_add(int length,char *new_data); //add data to the buffer
int buff_size(void);
};
När jag försöker
Kod: Markera allt
bool buff_get(char *new_loc) // Memcpy the data to a new location
{
memcpy(new_loc,Circ_buf::b_buf,(Circ_buf::b_pos-Circ_buf::b_sta));
}