+ 2

How to write a code in c++ that differentiates between using asterisk(*) for pointer declaration and the deference operator?

9th Jan 2018, 6:18 PM
Tesneem Tarik Mohamed
Tesneem Tarik Mohamed - avatar
2 Antworten
+ 1
Do you mean something like: int main() { int x = 5, *a = &x; // * - Declares Pointer to type 'int' cout<<*a<<endl; // * - Dereference Operator }
10th Jan 2018, 11:17 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
yes.thanks
10th Jan 2018, 10:48 PM
Tesneem Tarik Mohamed
Tesneem Tarik Mohamed - avatar