Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

Press Ctrl-V


LittleTommy42
 Share

Recommended Posts

#include <iostream>

 

int main()

{

int i = 0;

int *const p1 = &i;

const int ci = 42;

const int *p2 = &ci;

const int *const p3 = p2;

const int &r = ci;

 

i = ci;

p2 = p3;

 

std::cout << i << std::endl;

std::cout << *p2 << std::endl;

std::cout << r << std::endl;

system("pause");

return 0;

}

 

Some pointer shit to do with this c++ book.

Edited by Short
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share