I have a silly doubt
1) int *ptr
int count=6;
ptr &count;
cout<<*ptr<<endl;
2) int *ptr=5
cout<<*ptr<<endl;
In both the cases the value of *ptr is 5. Then why do we always do it as in the first case![]()
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 6 of 6
Thread: PointersThreaded View
|
Click Here to Expand Forum to Full Width |