consider the following :
string str;
char juju[50];
how can I put str content into juju?
juju = str wont work for sure and strcpy neither..
what else?
thx luigi
consider the following :
string str;
char juju[50];
how can I put str content into juju?
juju = str wont work for sure and strcpy neither..
what else?
thx luigi
strncpy( juju, str.c_str( ), str.length() );
juju[str.length()] = 0;
Have a wonderful day.... and keep smiling... you look terrific that way
signing off...
shiv... as i know him
It should be: juju[str.length()-1]Originally posted by shiv_tech_quest
strncpy( juju, str.c_str( ), str.length() );
juju[str.length()] = 0;
But this is still crappy code. What happens if the length of the string is 60?