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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:28:51+00:00 2026-05-25T14:28:51+00:00

Suppose First case int a; int *p= &a ; it works no error Second

  • 0

Suppose

First case

 int a;
 int *p= &a ; it works no error

Second case

 long int a;
 long int b;
 b = & a; it wont work 

Most of us say b is a variable not a pointer. But see the below.

So the question is if the &a returns the address which is an unsigned integer then why cant we assign it to a normal variable? But why only to pointers?
See below

b = (unsigned int) &a ; it works after typecasting though its not practicable.

If the address is integer format then why don’t the unsigned or long integers save it? I was thinking, there must be some hidden secret behind it. Could anyone reveal it? What I thought is, pointers must be doing something inside but I wonder what it would be and why a normal variable cant be.

Thanks for all your answers but the actual question what really the &a returns? Integer value or not? if it is integer number why a variable cannot hold it? long int a =65535 \valid why not int a= &b if value of address b is 65535

I’m not worried to use it as pointer, please the question is about just saving the value. Not deferencing the address. People saying 32 or 64 bit, I’m not worried about that. Why it cant save the address if address is a integer number?

I mean why cant we assign the value, I’m not saying to assign the properties of pointers to variable but just assign the value thats it

a=65535
b = a \\ works it assigns b - 65535
&a=65535
b = & a   \\ doesn't work, if address is a some integer value,why we can't store it in a variable?

take the 16 bit as example normal pointer (the address ) size is 2 bytes and variable size is 2 bytes why cant we store the address in other variable if address is integer value thats my question i find many answers like ++ it increments by 4 to pointer and value 1 to variable, not worried about that just assigning the value is more important question.

  b = & a ; address of a is 4000
  ++b ; becomes 4001 thats it,thats not a problem 
  • 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-25T14:28:52+00:00Added an answer on May 25, 2026 at 2:28 pm

    Integers, even long int, are not always going to be the same size as a pointer. Sometimes they will be (for example, most 32-bit architectures have sizeof(int) == sizeof(void *)), sometimes they will be different (for example, some 64-bit architectures have sizeof(long) == sizeof(void *) but some do not — Visual C++ on Windows being a prime example of a compiler where sizeof(long) != sizeof(void *)).

    There’s also the fact that void * is simply not the same type as long int.

    Imagine a class Foo and a class Bar, defined like so:

    class Foo {
       public: int a;
    };
    
    class Bar {
       public: int b;
    };
    

    It’s like asking why you can’t assign an instance of class Foo to a variable of type Bar — they’re not the same thing, even though in this case both Foo and Bar have the same underlying bit pattern.

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

Sidebar

Related Questions

Suppose I have two XML files. First XML File: <?xml version=1.0?> <AccessRequest xml:lang=en-US> <AccessLicenseNumber>Your_License</AccessLicenseNumber>
Suppose I have two applications written in C#. The first is a third party
Suppose I want to implement a reasonably efficient 'keyword recognition algorithm', that is first
Suppose I have two columns in a table that represents a graph, the first
I have question about normalization. Suppose I have an applications dealing with songs. First
Suppose there is a c++ method int NativeMethod(double, double *) in a Native.dll. My
Suppose that my machine word is 32 bits long, and I have to sort
Suppose: class Parser { public: void parser1(int a, int b, int c); void parser2(int
Suppose we have these local variables: int a = 0; int b = 1;
Suppose I have some simple struct like this: public struct WeightedInt { public 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.