To print address in c++

           There’s a difference to print address in c++

#include<iostream>
using namespace std;
int main()
{
char str1[]=”hello fuckers”;
char *p1=”fuck off”;
char *p2;
p2=str1;
cout<<endl<<str1<<endl<<p1;
cout<<endl<<p2;
cout<<endl<<(void *)str1; //address
cout<<endl<<(void *)p1;
cout<<endl<<(void *)p2;
return 0;
}

Advertisements