C++: assign two values to char** in one line? -


i try assign 2 c-strings @ once:

 char **pair = {"name","joe"}; 

but error message:

 'initializing' : cannot convert 'const char [5]' 'char **' 

but think worked me before?

joachim approach creates read-only string. that's how create array of const string literals.

another way,

// max_len being max string length. char pair[][max_len] = {"name","joe"}; // makes pair read-writeable,  

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -