1

Topic: The operator of obtaining of the address

Hello.
Prompt how to transform result of operation of obtaining of the address to the text.
Here so it turns out:

int main ()
{
int a = 1;
cout <<"&a =" <<&a <<"\n";
//char *b = &a;
//cout <<"b =" <<&a <<"\n";
system ("pause");
return 0;
}

and here so - is not present:

int main ()
{
int a = 1;
cout <<"&a =" <<&a <<"\n";
char *b = &a;
cout <<"b =" <<b <<"\n";
system ("pause");
return 0;
}

What data type is returned by this operation: &a?

2

Re: The operator of obtaining of the address

l-evgene wrote:

What data type is returned by this operation: &a?

The pointer on int.

3

Re: The operator of obtaining of the address

l-evgene;
Output to the screen http://www.cplusplus.com/reference/cstdio/printf/

printf ("%lld", b);

Conversion in std:: string http://www.cplusplus.com/reference/string/to_string/

string s = to_string ((long long) b);

As a matter of fact &a-> 32/64 bit  whole

4

Re: The operator of obtaining of the address

m_Sla, thanks.