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

The Archive Base Latest Questions

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

If I have two arrays likes this: short** x; short** y = functionThatReturnsAnArray(); In

  • 0

If I have two arrays likes this:

short** x;
short** y = functionThatReturnsAnArray();

In this situation sizeof(x) == sizeof(y).
Both are 4, I believe that this is because the outer array is simply an array of pointers and therefore doesn’t actually have any RAM allocated to it.

How can I find out that x has not been assigned a value?

Thanks,

Joe

  • 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-27T04:05:06+00:00Added an answer on May 27, 2026 at 4:05 am

    From a comment in your original post, what you mean is whether you can tell if a value has been assigned to a variable. We call that initialization. When a value hasn’t been stored to a variable it’s uninitialized, and that’s bad, because you never know what might be in there, and no, you cannot check whether it has been initialized, so initialize it when you declare it.


    sizeof(x) == sizeof(y) because they’re declared as the same type (short**); their contents don’t matter (sizeof is actually determined by the compiler, so it often can’t know what’s in it).

    If you want to know whether the memory areas that each point to are zero, you’ll need to do it manually (and you need to know how long each array is):

    int x_empty = 1;
    
    for(int i = 0; i < x_length_d1 && x_empty; i++) {
        if(x[i] == NULL) {
            // Handle a missing row however you want.
        }
        for(int j = 0; j < x_length_d2 && x_empty; j++) {
            if(x[i][j] != 0) x_empty = 0;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code here that has two arrays. It sorts arr[] , so
I have converted an array to object data like this: <?php $myobject->data = (object)Array('zero','one','two');
I have two arrays that I would like to compare and ultimately wind up
I have two arrays of animals (for example). $array = array( array( 'id' =>
I have two arrays in PHP. The first array ($author_array) is comprised of user_ids
so I have two arrays. one of them looks like this (it's values or
I have two arrays of attributes that describe products in the database: $sizes =
I have two arrays of values that I would like to combine - but
I have two PHP arrays like so: Array of X records containing the ID
I have two Doctrine entities that have a one-to-many relationship, like this: License class

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.