Mayank's C/C++ Challenger III

Mayank

Mayank

@mayank-MV7Gjv Oct 25, 2024
Hi All,

Sorry for the delay in comming up with this post in the C/C++ Challenger Series. This time I again have something from the C++ corner😁.

Question:
How would you write a constant reference to a constant pointer to integer
int i = 10 ;
int *const ptr = &i ;

So the syntax of the "integer" and the "pointer" is given. Tell me the way you will write the asked reference.
Hoping for a lots of replies.;-)


Thanks and Regards,
Mayank Shukla.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • desijays

    desijays

    @desijays-2SqnUc Nov 23, 2006

    int i = 10; // integer
    int *const ptr = &i; // constant pointer to an integer



    int *const & const i; //constant reference to a constant
    //pointer, that points to an integer.
  • desijays

    desijays

    @desijays-2SqnUc Nov 27, 2006

    dear mayank, u there mate. i've posted the probable solution 3 days ago. Im still waiting for you to tell me if its right or wrong... 😀
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Nov 27, 2006

    desijays
    dear mayank, u there mate. i've posted the probable solution 3 days ago. Im still waiting for you to tell me if its right or wrong... 😀
    Hold on, Desijays 😀 !

    Mayank seems to be totally busy these days. I'll ask him to reply asap.

    -The Big K-
  • Mayank

    Mayank

    @mayank-MV7Gjv Nov 28, 2006

    Hi desijays,

    You are absolutely correct \😁/

    Sorry for the delay friend, I was really very badly occupied with other stuffs 😔.

    Anyways, keeps the spirits HIGH.


    Thanks and Regards,
    Mayank Shukla.😁