Click here to Skip to main content
16,016,868 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionchange single instance app to multi instance? Pin
ThinkingPrometheus13-Aug-05 1:52
ThinkingPrometheus13-Aug-05 1:52 
AnswerRe: change single instance app to multi instance? Pin
John R. Shaw13-Aug-05 22:11
John R. Shaw13-Aug-05 22:11 
GeneralRe: change single instance app to multi instance? Pin
ThinkingPrometheus15-Aug-05 20:21
ThinkingPrometheus15-Aug-05 20:21 
GeneralRe: change single instance app to multi instance? Pin
Why_Am_I_Anonymous_Again16-Aug-05 21:57
sussWhy_Am_I_Anonymous_Again16-Aug-05 21:57 
GeneralRe: change single instance app to multi instance? Pin
ThinkingPrometheus16-Aug-05 22:11
ThinkingPrometheus16-Aug-05 22:11 
GeneralMonitoring Websites Pin
nripun13-Aug-05 1:15
nripun13-Aug-05 1:15 
GeneralReference question Pin
LiYS12-Aug-05 23:55
LiYS12-Aug-05 23:55 
GeneralRe: Reference question Pin
Bhaskar13-Aug-05 1:51
Bhaskar13-Aug-05 1:51 
There's no contradiction.

Check this modified code
int x = 10;<br />
int y = 20;<br />
int& r = x;  // make r refer to x<br />
r = y; // this does not change the reference, value of y is copied to r, i.e., to x<br />
r += 10; // this will modify x, not y, because r still refers to x, not y<br />
cout << r << " " << x << " " << y ; // prints 30 30 20



For the second one, you have created reference to a pointer in the function parameter A*& a. By this it means a refers to a pointer of type A which it can modify. However when you pass &a to the function h, &a is not modifiable.

Check this sample code
A a1, a2;<br />
A* p1;<br />
A* &r1 = p1; // Ok, r1 refers to a modifiable pointer p1<br />
p1 = &a1;  // p1 points to a1<br />
r1 = &a2; // now p1 points to a2<br />
<br />
A* &r2 = &a2; // ERROR: &a2 is not modifiable, &a2 is a constant pointer

GeneralRe: Reference question Pin
LiYS13-Aug-05 3:49
LiYS13-Aug-05 3:49 
GeneralRe: Reference question Pin
Jose Lamas Rios13-Aug-05 6:58
Jose Lamas Rios13-Aug-05 6:58 
GeneralRe: Reference question Pin
S. Senthil Kumar13-Aug-05 7:04
S. Senthil Kumar13-Aug-05 7:04 
GeneralRe: Reference question Pin
Jose Lamas Rios13-Aug-05 7:23
Jose Lamas Rios13-Aug-05 7:23 
GeneralRe: Reference question Pin
LiYS13-Aug-05 16:19
LiYS13-Aug-05 16:19 
GeneralRe: Reference question Pin
S. Senthil Kumar13-Aug-05 6:59
S. Senthil Kumar13-Aug-05 6:59 
Generalshow background image on a window Pin
Ankit Aneja12-Aug-05 23:46
Ankit Aneja12-Aug-05 23:46 
GeneralRe: show background image on a window Pin
ThatsAlok13-Aug-05 0:08
ThatsAlok13-Aug-05 0:08 
GeneralRe: show background image on a window Pin
Ankit Aneja13-Aug-05 3:01
Ankit Aneja13-Aug-05 3:01 
GeneralRe: show background image on a window Pin
Achim Klein13-Aug-05 8:06
Achim Klein13-Aug-05 8:06 
GeneralRe: show background image on a window Pin
Ankit Aneja13-Aug-05 18:50
Ankit Aneja13-Aug-05 18:50 
GeneralRe: show background image on a window Pin
Jose Lamas Rios13-Aug-05 22:32
Jose Lamas Rios13-Aug-05 22:32 
GeneralRe: show background image on a window Pin
Ankit Aneja13-Aug-05 23:13
Ankit Aneja13-Aug-05 23:13 
GeneralRe: show background image on a window Pin
Achim Klein14-Aug-05 2:44
Achim Klein14-Aug-05 2:44 
GeneralSetThreadLocale() Pin
Ali Tavakol12-Aug-05 23:45
Ali Tavakol12-Aug-05 23:45 
GeneralProcess Priority Pin
Abd.Eskandari12-Aug-05 23:34
Abd.Eskandari12-Aug-05 23:34 
GeneralRe: Process Priority Pin
Bob Stanneveld13-Aug-05 6:07
Bob Stanneveld13-Aug-05 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.