0

How do I use a pointer with a 2-dim array? I am converting string to char array.

char x[25][100];
const char* A= x;


A= x.c_str();

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
0

1) const char* A = a[0]; will point to the first of 25 strings in the 2d array.

2) A = x.c_str() doesn[t work because x is not c++ std::string class. character arrays like x do not have methods.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.