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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:38:27+00:00 2026-06-04T16:38:27+00:00

At some places I have seen variables declared like this const int &var1; extern

  • 0

At some places I have seen variables declared like this

const int &var1;
extern int & var2;

These variables are defined somewhere else. I always thought that when you declare a reference to a variable you bind the reference to that variable at the same place. I am missing something here. Also I have not seen references declared as above when there is no qualifier (e.g. const or extern).

  • 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-04T16:38:28+00:00Added an answer on June 4, 2026 at 4:38 pm

    The actual declaration of a variable, let it be a reference or a pointer or a normal variable, has nothing to do with the type of a variable.

    Even if in your examples you have references to variables this means nothing related to where they are initialized. Having a reference is useful because you assign it from another variable and you can actually use them as a pointer without caring about dereferincing it but nothing more, it is a variable like any other.

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

Sidebar

Related Questions

I'm taking some information from some variables I have already defined outside this function
I've seen this sort of code some places: public event SomeEventHandler SomeEvent = (s,
I have seen some other posts on how to get this working ... however
I have seen a function whose prototype is: int myfunc(void** ppt) This function is
I have seen in some places that while using Expandable List View we register
I have seen this show up several places in code, never with an explanation,
I'm working on a class-based php web app. I have some places where objects
I think you programmers must have some interesting naming convention of variables. I have
I have seen process.nextTick used in a few places and can't quite tell what
I have seen many places say quicksort is good because it fits to cache-related

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.