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

  • Home
  • SEARCH
  • 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 7811087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:02:01+00:00 2026-06-02T04:02:01+00:00

Can someone set the path straight on the disparities between these ubiquitous, as It

  • 0

Can someone set the path straight on the disparities between these ubiquitous, as It can get a bit mind blowing.

For example if I have a 2D array such as rec[3][2], the following access means the same;

rec[0][0] = **rec
rec[i][0] = **(rec + i)
*(*(rec + i) + j) = rec[i][j]

If this is the case then what are the meaning of these:

#include <stdio.h>
double *recptr[3];
int i=1;

main()
{
 double n1=12.0;
 doublw n2=3.4;

 recptr[0]= &n1;
 recptr[1]= &n2;

 printf("Amt: %.2f\n", **(recptr + i));
}

What is **(recptr + i), Is this access to 2D pointer or ponter-to-pointer reference?

foo(ptr2ptr)double **ptr2ptr;
{
 int i=1, j=0;
 if(**(ptr2ptr +i) > **(ptr2ptr + j))
 {
  double *tmp= *(recptr +i);
 }
}

Again what is the difference between *(recptr +i) and **(ptr2ptr +i)?! is the later also 2D access or access to pointer-2-ponter reference and the earlier the object pointed to?

  • 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-06-02T04:02:02+00:00Added an answer on June 2, 2026 at 4:02 am
    double *recptr[3];
    

    This creates an array of 3 pointers to double (double*).
    Now, in the main(), we have double n1 = 12.0f and double n2 = 3.4f.

    Now we assign the address of n1 (&n1) to recptr[0] (First element of the array which just happens to point to doubles, so now it points to an address of a double (our n1) which is ok.) -> Please do note this is NOT a reference (in theory). We are taking the address of n1.

    We do the same thing with n2, so now recptr[1] is a pointer that points to the address of n2.

    Now we print **(recptr + i) -> This means the following:

    We take the address of the first element of the array (recptr evaluates to the address of the aray), we offset this address by i (which just happens to be 1). Now please do note that we don’t move 1 byte further, we move sizeof(double*) bytes further.

    Now, we dereference this position *(recptr + i) which is (address of first element + sizeof(double*) bytes) away and what do we see ? Well, it’s a pointer to a double (Or in other words, it’s just an address of n2). So we need to dereference yet again to actually see the value that this particular pointer points to, hence **(recptr + i).

    So, the first dereference just gives us the correct “cell” of our recptr array but in that cell, there’s a pointer to a double, so in order to get to it’s value, we need to dereference yet again.

    (We then indeed print 3.40 since it’s address happens to live in the second cell of recptr array.)

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

Sidebar

Related Questions

I'm trying to accomplish a task, but having some difficulty.Can someone set me straight
Can someone advise me on how to set the path for the firefox exe
Can someone tell me how to set file permissions in Delphi 2006? I am
Can someone give me some code to set the cell of an excel spreadsheet
Can someone point me to some tutorial on how to set up a ping
Can someone suggest me a way to map a template classes with a set
Can someone please explain to me why the hell? When I try to set
Hopefully someone here can help me! I'm trying to set up fancybox so when
Can someone explain to me why this happens? I have a file called profile.php
Can someone help explain what configuration I'm missing to get the Sencha Ext JS

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.