User profile: limchankhim

User info
User name:limchankhim
Name:lim chan khim
Location:penang
Bio:declaring pointers

// more pointers
#include <iostream>
using namespace std;

int main ()
{
int firstvalue = 5, secondvalue = 15;
int * p1, * p2;

p1 = &firstvalue; // p1 = address of firstvalue
p2 = &secondvalue; // p2 = address of secondvalue
*p1 = 10; // value pointed to by p1 = 10
*p2 = *p1; // value pointed to by p2 = value pointed to by p1
p1 = p2; // p1 = p2 (value of pointer is copied)
*p1 = 20; // value pointed to by p1 = 20

cout << "firstvalue is " << firstvalue << '\n';
cout << "secondvalue is " << secondvalue << '\n';
return 0;
}


why secondvalue is 20 ? i no understand this programming pls explain tq
Statistical data
Birthdate:May 12, 1989
Gender:Male
Occupation:Student
Skills:C++
History
Joined:
Number of posts:27
Latest posts:

PHP sending email failed
hi where can find website send PHP question? do you have website?

PHP sending email failed
i use real email and how should i do can tell me step by step?

PHP sending email failed
please help me check what problem why sending email failed thank you! (File sendmail.php) <?...

Pointer declare
pointer const

Pointer declare
#include <iostream> using namespace std; void increment_all (int* start, int* stop) { int * curre...