Tuesday 6 April 2021

Pointer in C and C++ Qus 1

 #include<stdio.h>

#include<iostream.h>

#include<conio.h>

main()

{

clrscr();

int a=5;

int* p=&a;

cout<<a<<endl;

cout<<p<<endl;  //fff4

cout<<&a<<endl;

cout<<*p<<endl;  //5

cout<<p+1<<endl;   //fff6

cout<<*p+1<<endl;   //6

getch();

return 0;

}

No comments:

Post a Comment