Click here to Skip to main content
15,936,565 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep27-Jul-15 18:12
enhzflep27-Jul-15 18:12 
No problem, it's one of the problems that seems to beat-up people regularly. I more or less started with ASM, so it was a matter of sink or swim in short order.

How about this, does it help?
C++
int main()
{
    // double array of pointers
   char *stringTable[][4] = {
                                { "string 1", "string two", "string three", NULL },
                                { "second string 1", "second string two", "second string three", NULL }
                            };

    int y;
    for (y=0; y<sizeof(stringTable)/sizeof(stringTable[0]); y++)   // y < (32/16) - 32bit code
    {
        char **curPtr = stringTable[y];
        do
        {
            printf("%s\n", *curPtr++);
        } while (*curPtr);
        printf("----\n");
    }
}
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon

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 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 20:47
mveCPallini23-Jul-15 20:47 

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.