Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: onkeydown event not working ? Pin
Amarelia15-Aug-05 19:22
Amarelia15-Aug-05 19:22 
GeneralVisual C++ program calling another program Pin
Anonymous15-Aug-05 1:21
Anonymous15-Aug-05 1:21 
GeneralRe: Visual C++ program calling another program Pin
Joel Holdsworth15-Aug-05 1:51
Joel Holdsworth15-Aug-05 1:51 
GeneralRe: Visual C++ program calling another program Pin
Anonymous15-Aug-05 2:09
Anonymous15-Aug-05 2:09 
GeneralRe: Visual C++ program calling another program Pin
BlackDice15-Aug-05 3:14
BlackDice15-Aug-05 3:14 
GeneralRe: Visual C++ program calling another program Pin
David Crow15-Aug-05 3:21
David Crow15-Aug-05 3:21 
GeneralRe: Visual C++ program calling another program Pin
David Crow15-Aug-05 3:17
David Crow15-Aug-05 3:17 
GeneralConst reference Pin
LiYS15-Aug-05 0:34
LiYS15-Aug-05 0:34 
I'm doing the excercise after the chapter about copy-constructor, Here's how it goes:


Create a very simple class, and a function that returns an
object of that class by value. Create a second function that
takes a reference to an object of your class. Call the first
function as the argument of the second function, and
demonstrate that the second function must use a const
reference as its argument.


And here's my implementation:

extern class A;
A fun1()
{
   return A(); 
}

void fun2(A& a)
{
}
int main()
{
	fun2(fun1());
}



I believe I've done exactly what the author has described, but It seems fun2(...) doesn't have to take a argument of const reference and compiler doesn't complain too!In addition what's the effect of calling A() inside fun1(...) instead of

A a
return a;




GeneralRe: Const reference Pin
mark novak15-Aug-05 0:49
mark novak15-Aug-05 0:49 
GeneralRe: Const reference Pin
LiYS15-Aug-05 4:03
LiYS15-Aug-05 4:03 
GeneralOpening a file for read when it is already open by another application Pin
ArthurDt15-Aug-05 0:06
ArthurDt15-Aug-05 0:06 
GeneralRe: Opening a file for read when it is already open by another application Pin
Steve S15-Aug-05 0:15
Steve S15-Aug-05 0:15 
GeneralRe: Opening a file for read when it is already open by another application Pin
ArthurDt15-Aug-05 0:36
ArthurDt15-Aug-05 0:36 
GeneralRe: Opening a file for read when it is already open by another application Pin
HumanOsc15-Aug-05 0:21
HumanOsc15-Aug-05 0:21 
GeneralRe: Opening a file for read when it is already open by another application Pin
ArthurDt15-Aug-05 0:37
ArthurDt15-Aug-05 0:37 
GeneralRe: Opening a file for read when it is already open by another application Pin
u6ik15-Aug-05 0:22
u6ik15-Aug-05 0:22 
GeneralRe: Opening a file for read when it is already open by another application Pin
ArthurDt15-Aug-05 0:39
ArthurDt15-Aug-05 0:39 
QuestionHow to get the Font width ??? Pin
HumanOsc15-Aug-05 0:04
HumanOsc15-Aug-05 0:04 
AnswerRe: How to get the Font width ??? Pin
alias001815-Aug-05 0:21
alias001815-Aug-05 0:21 
GeneralRe: How to get the Font width ??? Pin
Steve S15-Aug-05 0:22
Steve S15-Aug-05 0:22 
AnswerRe: How to get the Font width ??? Pin
Steve S15-Aug-05 0:21
Steve S15-Aug-05 0:21 
AnswerRe: How to get the Font width ??? Pin
mark novak15-Aug-05 0:30
mark novak15-Aug-05 0:30 
GeneralRe: How to get the Font width ??? Pin
HumanOsc15-Aug-05 0:31
HumanOsc15-Aug-05 0:31 
GeneralRe: How to get the Font width ??? Pin
HumanOsc15-Aug-05 0:41
HumanOsc15-Aug-05 0:41 
GeneralRe: How to get the Font width ??? Pin
mark novak15-Aug-05 1:07
mark novak15-Aug-05 1: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.