0

Basically I have three char**: **A, **B and **C. I want to make a pointer that shows A,B and C like this:

ptr[0] will be **A
ptr[1] will be **B;
ptr[2] will be **C;

so if I add one at ptr it will show me the next array. And if this is possible then how I can represent A[i][j] with the pointer?

2
  • char *ptr[] = { *A, *B, *C };, then ptr[i][j]? Commented Dec 2, 2011 at 17:54
  • 1
    I have the feeling that you are envisioning this as the solution to a particular problem you faced. Sometimes it is better to ask about the root problem, rather than the solution you think you want. Commented Dec 2, 2011 at 18:46

1 Answer 1

2

It sounds like you want something like this:

char **ptr[] = { A, B, C };

char x = ptr[0][i][j];  // x is now equal to A[i][j]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.