...

View Full Version : diffrences between char pointer int pointer array



digrev
07-13-2012, 07:46 PM
hi i am trying too learn pointer aritmathics but i dont understand one thing
let me explain
in this code i get the adress value or just the values that pointer contains


int dizi[3]={1,2,3};
int *ptr=dizi;
cout<<*ptr;(no problem with value)
cout<<ptr;(no problem with adress)

but i cant do the same thing with the char array


char dizi[10]="blabla";
char *p=dizi;
cout<<&p[0](cannot get adress );
or this
cout<<p](cannot get adress );



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum