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 6913295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:12:00+00:00 2026-05-27T09:12:00+00:00

I have this multi-dimensional array: char marr[][3] = {{abc},{def}}; Now if we encounter the

  • 0

I have this multi-dimensional array:

char marr[][3] = {{"abc"},{"def"}};

Now if we encounter the expression *marr by definition (ISO/IEC 9899:1999) it says (and I quote)

If the operand has type ‘pointer to type’, the result has type ‘type’

and we have in that expression that marr decays to a pointer to his first element which in this case is a pointer to an array so we get back ‘type’ array of size 3 when we we have the expression *marr. So my question is why when we do (*marr) + 1 we add 1 byte only to the address instead of 3 which is the size of the array.

Excuse my ignorance I am not a very bright person I get stuck sometimes on trivial things like this.

Thank you for your time.

  • 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-27T09:12:01+00:00Added an answer on May 27, 2026 at 9:12 am

    It adds one because the type is char (1 byte). Just like:

    char *p = 0x00;
    ++p; /* is now 0x01 */
    

    When you dereference a char [][] it will be used as char * in an expression.

    To add 3, you need to do the arithmetic first and then dereference:

    *(marr+1)
    

    You were doing:

    (*marr)+1
    

    which dereferences first.

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

Sidebar

Related Questions

I have a multi-dimensional array right now that looks like this: function art_appreciation_feeds() {
I have a multi dimensional array, like this: array('name' => array('title'=>'Title','date'=>'Created')) I store it
Possible Duplicate: php multi-dimensional array remove duplicate I have an array like this: $a
This is a followup to Multi-dimensional char array (array of strings) in python ctypes
I have a multi-dimensional array that looks like this: The base array is indexed
So I have a multi-dimensional array looks like this. $config = array( First Name
I have a multi-dimensional array with 4 entries in each value - (1st name,
i have multi dimensional array like below, Array ( [14289] => Array ( [0]
I have a multi-dimensional multi-object array from a simplexml_import_dom() function call. A slice of
Let say I have a multi-dimensional array like int a[10][10] int b[10][10] void arrayCopy(int*

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.