C++ language

R4R® C++
(追記) (追記ここまで)
(追記) (追記ここまで)
Program Of Pointer

Example:

#include<iostream.h>
int main()
{
int firstval=5, secondval=15;
int *p1,*p2;
p1=&firstval; //p1=address of firstval
p2=&secondval; //p2=address of secondval
*p1=10; //value pointed y p1=10
*p2=*p1; //value pointed y p2=value pointed y p1
p1=p2; //value of pointer is copied
*p1=20; //value pointed by p1=20
cout<<"firstval is"<<firstval;
cout<<"secondval is"<<secondval;
return 0;
}

Output:

first value is 10
second value is 20
(追記) (追記ここまで)
Copyright ©2021-22 r4r.co.in, all rights reserved. Theguestspost.com
Sitemap
Career
Post comment
About us
Subscription
Unsubscription

AltStyle によって変換されたページ (->オリジナル) /