union // deque

M

Michael Sgier

Hi
with record.field[j].charData = s;
i get this error:
error: 'class CDatabaseField' has no member named 'charData'

field is a instance of CDatabaseField?
std::deque<CDatabaseField> field;
I dont fully understand deque. it doesnt need to be allocated? What does
that mean?
Also union is not in my book...what is union?
why doesn't that below work?
Thanks Michael


class CDatabaseField {
public:
union {
char charData[256];
double doubleData;
long intData;
} data;
};
 
V

Victor Bazarov

Michael said:
with record.field[j].charData = s;
i get this error:
error: 'class CDatabaseField' has no member named 'charData'

field is a instance of CDatabaseField?


Are you asking us?
std::deque<CDatabaseField> field;
I dont fully understand deque. it doesnt need to be allocated? What
does that mean?

'deque' is a "double-ended queue". What book on the Standard Library
are you reading that doesn't describe it?
Also union is not in my book...what is union?

A union is a data structure such that elements share the same memory
location.
why doesn't that below work?
Thanks Michael


class CDatabaseField {
public:
union {
char charData[256];

'charData' is an array. We cannot assign to arrays.
double doubleData;
long intData;
} data;
};

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top