Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 242613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:51:08+00:00 2026-05-11T20:51:08+00:00

char **Data[70]={NULL}; What is the correct terminology for this? How else could it be

  • 0
char **Data[70]={NULL};  

What is the correct terminology for this? How else could it be written? What does it look like in memory? I am reading many tutorials on pointers but I don’t see it in this syntax. Any help is appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:51:08+00:00Added an answer on May 11, 2026 at 8:51 pm

    This structure

    char **Data[70]={NULL};
    

    is an array of 70 pointers to pointers to char. The compiler allocates 70 * sizeof(char**) bytes for this array, which assuming 32-bit pointers is 280 bytes.

    If you internally think of a “pointer to char” as a string, which isn’t true but it’s close enough, then this is an array of 70 pointers to strings. To make some ASCII art and pretend that you have allocated and filled some values….

     Array of        One or more
     char **           char *
    +---------+     +---------+
    |    0    | --> |   ptr   | -->  "Hello, world"
    +---------+     +---------+
    |    1    |
    +---------+       +---------+
    |    2    | ----> |  ptr2   | -->  "Goodbye, cruel world"
    +---------+       +---------+
    |    3    |
    +---------+         +---------+
    |    4    | ------> | ptr3[0] | -->  "Message 0"
    +---------+         +---------+
        ...             | ptr3[1] | -->  "Message 1"
    +---------+         +---------+
    |   69    |         | ptr3[2] | -->  "Message 2"
    +---------+         +---------+
    

    You could do the above with code like this (error checking malloc return values skipped):

    char **Data[70]={NULL};
    char **ptr, **ptr2, **ptr3;
    
    ptr = (char **) malloc(sizeof(char *));
    *ptr = "Hello, world";
    Data[0] = ptr;
    
    ptr2 = (char **) malloc(sizeof(char *));
    *ptr2 = "Goodbye, cruel world";
    Data[2] = ptr2;
    
    ptr3 = (char **) malloc(10 * sizeof(char *));
    Data[4] = ptr3;
    
    ptr3[0] = "Message 0";
    ptr3[1] = "Message 1";
     ...
    ptr3[9] = "Message 9"; 
    
    printf("%s\n", *Data[0]);
    printf("%s\n", Data[2][0]);
    printf("%s\n", Data[4][0]);
    printf("%s\n", Data[4][1]);
          ...
    printf("%s\n", Data[4][9]);
    

    Think of it this way: Each entry in the array is a char **. Each entry can point to an arbitrary location in memory, said location(s) being char * and thus being able to point to a null-terminated character array aka “string.”

    Note carefully the distinction between this and what you get when you allocate a 2D array:

    char *Data2[10][70]={NULL};
    

    The allocation of Data2 above gives you a 2-dimensional array of char * pointers, said 2-d array being allocated in a single chunk of memory (10 * 70 * sizeof(char*) bytes, or 2800 bytes with 32-bit pointers). You don’t have the ability to assign the char ** pointers to arbitrary locations in memory that you have with the single-dimensional array of char ** pointers.

    Also note (given above declarations of Data and Data2) that the compiler will generate different code for the following array references:

    Data[0][0]
    Data2[0][0]
    

    Here’s another way to think about this: Imagine that you have several arrays of pointers to strings:

    char *table0[] = { "Tree", "Bench", "Stream" };
    char *table1[] = { "Cow", "Dog", "Cat" };
    char *table2[] = { "Banana", "Carrot", "Broccoli" };
    char **Data[3];
    
    Data[0] = table0;
    Data[1] = table1;
    Data[2] = table2;
    

    You have an array of pointers to “array of pointer to char”. If you now print the value of data[1][1], think of it like this: data[1] gets you a pointer to the array table1. Then the value table1[1] equals "Dog".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 173k
  • Answers 173k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In regular .NET, it doesn't and can't (unless you tell… May 12, 2026 at 2:44 pm
  • Editorial Team
    Editorial Team added an answer I just stumbled upon this post and am building a… May 12, 2026 at 2:44 pm
  • Editorial Team
    Editorial Team added an answer WPF has a powerful concept named Attached Properties. I'm not… May 12, 2026 at 2:44 pm

Related Questions

I am attempting to read audio data via AudioQueue. When I do so, I
Sometimes, it is useful to hide a string from a binary (executable) file. For
I am new to powershell, and I am trying to add error handling via
I have this array: unsigned char* data = CGBitmapContextGetData(cgctx); then I tried to get

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.