Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int abc = 5, *intptr;
- char chval = 'f', *chvalptr;
- bool blval = true, *blvalptr;
- float flval = 3.53, *flvalptr;
- intptr = &abc;
- chvalptr = &chval;
- blvalptr = &blval;
- flvalptr = &flval;
- cout << "Size of the int pointer = " << sizeof(intptr) << " Address = " << intptr << " Value = " << *intptr<<endl;
- cout << "Size of the char pointer = " << sizeof(chvalptr) << " Address = " << chvalptr << " Value = " << *chvalptr << endl;
- cout << "Size of the boolean pointer = " << sizeof(blvalptr) << " Address = " << blvalptr << " Value = " << *blvalptr << endl;
- cout << "Size of the float pointer = " << sizeof(flvalptr) << " Address = " << flvalptr << " Value = " << *flvalptr << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment