Click here to Skip to main content
15,904,652 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error reading characters of string Pin
SundararamanS28-Jul-15 23:39
SundararamanS28-Jul-15 23:39 
QuestionAccessing / printing two dimensional array of char using pointers Pin
Vaclav_26-Jul-15 4:06
Vaclav_26-Jul-15 4:06 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
Richard MacCutchan26-Jul-15 5:51
mveRichard MacCutchan26-Jul-15 5:51 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep26-Jul-15 6:47
enhzflep26-Jul-15 6:47 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_26-Jul-15 7:35
Vaclav_26-Jul-15 7:35 
QuestionRe: Accessing / printing two dimensional array of char using pointers Pin
CPallini26-Jul-15 20:49
mveCPallini26-Jul-15 20:49 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep27-Jul-15 0:54
enhzflep27-Jul-15 0:54 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_27-Jul-15 15:23
Vaclav_27-Jul-15 15:23 
Ok I think I am getting the picture.
But I cannot figure out how to implement same pointer arithmetic in double array.
I got the first "record" working fine, can access all strings / fields, but cannot get to the next one.

I am still not sure how does the pointer , and not the char in array , get incremented.

I have deleted the LCD code which confused many and added printf , which is not part of "core" Arduino code , so this should pass by them now.

I still would like some verbal description of the assignment of pointer to the array.
Appreciate your help very much.
Cheers
Vaclav





<pre lang="c++"> // double array of pointers
char *stringTable[][5] = {{ "string 1", "string two", "string three", NULL },
{ "second string 1", "second string two", "second string three", NULL }

};

char **curPtr = *stringTable; // pointer to array of pointers


do
{
printf("%s\n", *curPtr++); // dereference to get the ptr to the string
} while ( *curPtr ); // quit loop when we get to our NULL pointer.<pre lang="c++"><pre lang="c++"></pre></pre></pre>
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep27-Jul-15 18:12
enhzflep27-Jul-15 18:12 
GeneralSOLVED Re: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_28-Jul-15 4:04
Vaclav_28-Jul-15 4:04 
QuestionRe: Accessing / printing two dimensional array of char using pointers Pin
David Crow27-Jul-15 4:59
David Crow27-Jul-15 4:59 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
Jeremy Falcon27-Jul-15 5:13
professionalJeremy Falcon27-Jul-15 5:13 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_27-Jul-15 5:51
Vaclav_27-Jul-15 5:51 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Jeremy Falcon27-Jul-15 6:01
professionalJeremy Falcon27-Jul-15 6:01 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Richard MacCutchan27-Jul-15 7:20
mveRichard MacCutchan27-Jul-15 7:20 
QuestionAdd button to vertical toolbar embedded in CPagerCtrl embedded in CDockingPane attached to CFrameWndEx Pin
Craig Hewitt24-Jul-15 9:02
professionalCraig Hewitt24-Jul-15 9:02 
QuestionC or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed22-Jul-15 20:16
Abdullah A._Mohamed22-Jul-15 20:16 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini22-Jul-15 20:37
mveCPallini22-Jul-15 20:37 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Richard Deeming23-Jul-15 2:00
mveRichard Deeming23-Jul-15 2:00 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 2:06
mveCPallini23-Jul-15 2:06 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed23-Jul-15 19:19
Abdullah A._Mohamed23-Jul-15 19:19 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 20:45
mveCPallini23-Jul-15 20:45 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin23-Jul-15 14:57
professionalAlbert Holguin23-Jul-15 14:57 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed23-Jul-15 19:28
Abdullah A._Mohamed23-Jul-15 19:28 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin24-Jul-15 4:11
professionalAlbert Holguin24-Jul-15 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.