documentc

2

Click here to load reader

Upload: parul-bhatia

Post on 13-Apr-2017

17 views

Category:

Software


0 download

TRANSCRIPT

Page 1: DocumentC

int *pi;

//char c[] = "NIKHIL";

//char *pc = c;

//char **ppc = &pc;

char c[] = "NIKHIL";

char *p = "NIKHIL";

//c = c + 2;

//char *c1;

//char *c2;

//c1 = c;

//c2 = c+1;

//char *p_c[] = {c1,c2};

//c1 = c+4;

//c2 = c+5;

//int a[10] = {1,2,3,4,5,6,7,8,9,10};

//const char *c[] = {"NIKHIL","RIYA"};

//char *new_c[] = {c[0],c[1]};

//char *p_c = "NIKHIL";

printf("\n c is pointing to address %x", *p);

//cout << "\n Address of c is " << c;

cout << "\n Address of p contains string " << *(c+1);

printf("\n c is pointing to address %x", c);

//cout << "\n Address of c is " << c;

//cout << "\n Address of p is " << p;

printf("\n p is pointing to address %x %x", p, &p);

Page 2: DocumentC

p = p + 2;

//cout << "\n Address which p is pointing to" << p;

printf("\n p is pointing to address %x %x", p, &p);