Click here to Skip to main content
14,457,986 members

C / C++ / MFC

 
QuestionAccessing / printing two dimensional array of char using pointers Pin
Vaclav_26-Jul-15 5:06
MemberVaclav_26-Jul-15 5:06 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
Richard MacCutchan26-Jul-15 6:51
communityengineerRichard MacCutchan26-Jul-15 6:51 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep26-Jul-15 7:47
Memberenhzflep26-Jul-15 7:47 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_26-Jul-15 8:35
MemberVaclav_26-Jul-15 8:35 
QuestionRe: Accessing / printing two dimensional array of char using pointers Pin
CPallini26-Jul-15 21:49
mveCPallini26-Jul-15 21:49 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep27-Jul-15 1:54
Memberenhzflep27-Jul-15 1:54 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_27-Jul-15 16:23
MemberVaclav_27-Jul-15 16:23 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
enhzflep27-Jul-15 19:12
Memberenhzflep27-Jul-15 19: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?
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 5:04
MemberVaclav_28-Jul-15 5:04 
QuestionRe: Accessing / printing two dimensional array of char using pointers Pin
David Crow27-Jul-15 5:59
MemberDavid Crow27-Jul-15 5:59 
AnswerRe: Accessing / printing two dimensional array of char using pointers Pin
Jeremy Falcon27-Jul-15 6:13
professionalJeremy Falcon27-Jul-15 6:13 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Vaclav_27-Jul-15 6:51
MemberVaclav_27-Jul-15 6:51 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Jeremy Falcon27-Jul-15 7:01
professionalJeremy Falcon27-Jul-15 7:01 
GeneralRe: Accessing / printing two dimensional array of char using pointers Pin
Richard MacCutchan27-Jul-15 8:20
communityengineerRichard MacCutchan27-Jul-15 8:20 
QuestionAdd button to vertical toolbar embedded in CPagerCtrl embedded in CDockingPane attached to CFrameWndEx Pin
Craig Hewitt24-Jul-15 10:02
professionalCraig Hewitt24-Jul-15 10:02 
QuestionC or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed22-Jul-15 21:16
MemberAbdullah A._Mohamed22-Jul-15 21:16 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini22-Jul-15 21:37
mveCPallini22-Jul-15 21:37 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Richard Deeming23-Jul-15 3:00
communityengineerRichard Deeming23-Jul-15 3:00 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 3:06
mveCPallini23-Jul-15 3:06 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed23-Jul-15 20:19
MemberAbdullah A._Mohamed23-Jul-15 20:19 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 21:45
mveCPallini23-Jul-15 21:45 
AnswerRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin23-Jul-15 15:57
professionalAlbert Holguin23-Jul-15 15:57 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Abdullah A._Mohamed23-Jul-15 20:28
MemberAbdullah A._Mohamed23-Jul-15 20:28 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
Albert Holguin24-Jul-15 5:11
professionalAlbert Holguin24-Jul-15 5:11 
GeneralRe: C or C++ for customized embedded Linux, which is the best and why? Pin
CPallini23-Jul-15 21:47
mveCPallini23-Jul-15 21: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.