Thanks Here you are
struct W__header {
int number;
char title [200];
double inicial, final;
int num;
float interval;
};
struct W__header {
int number;
char title [200];
double inicial, final;
int num;
float interval;
};
To copy to clipboard, switch view to plain text mode
To set the title I have ( I think here is the problem :
void set_title(std::string txt) {
strncpy(title,texto.c_str(),200) ; }
void set_title(std::string txt) {
strncpy(title,texto.c_str(),200) ; }
To copy to clipboard, switch view to plain text mode
And my 'put' function :
template <class TTput_stream>
void W_inpout::W_stream::put (TTput_stream &value) {
loc+= sizeof value; it works fine
lof=loc;
const char * buffer ;
buffer = reinterpret_cast<const char*> (&value);
}
template <class TTput_stream>
void W_inpout::W_stream::put (TTput_stream &value) {
loc+= sizeof value; it works fine
lof=loc;
const char * buffer ;
buffer = reinterpret_cast<const char*> (&value);
}
To copy to clipboard, switch view to plain text mode
I user put(my_class->header);
The buffer and the function works fine with my other structures.
At debugger I see title filled with the std::text passed to ser_title an a lot of \0 until the end of var
Maybe reinterpret_cast does not work becase the structure has the char 'title' inside it ?
Any help would be appreciated.
Bookmarks