0

In desperate need of help, I can’t figure this out

I can’t figure out how to do this: can anyone help? Write a C++ program where the user has to to enter integers as inputs to be stored in the variables 'a' and 'b' respectively. There are also two integer pointers named ptrA and ptrB. Assign the values of 'a' and 'b' to ptrA and ptrB respectively, and display them.

22nd Jul 2020, 6:59 PM
Vivian Ortiz
Vivian Ortiz - avatar
2 Answers
+ 2
Well it's a basic one :- int a, b; cin >> a >> b; int *ptrA, *ptrB; ptrA = &a; ptrB = &b; cout << *ptrA << ptrB;
23rd Jul 2020, 2:43 AM
Harshit Sharma
Harshit Sharma - avatar
+ 1
thank you Harshit!!!
23rd Jul 2020, 3:05 AM
Vivian Ortiz
Vivian Ortiz - avatar