undefined type in C++

Status
Not open for further replies.

ever_thus

Baseband Member
Messages
94
I'm writing a template class in C++ which, among other things, fills arrays passed to member functions. Occasionally the array might be larger than the data structure from which it's being filled. I'd like to fill the excess elements with data that it will be clear did not come the class.

If I leave the element untouched, the garbage in there could be interperted as valid data, as could any "flag" value I can think of. A further complication is that the data could be of any type.

A solution that works in C too would be more useful, as I anticipate encountering this problem again in the future.
 
Your member functions could just return an integer value that indicates the number of cells that are filled.
 
Status
Not open for further replies.
Back
Top Bottom