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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -