Click here to Skip to main content
15,903,012 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionThe Editbox is working in XP, but it is white in color in Vista! Pin
LaHaHa13-Nov-08 17:39
LaHaHa13-Nov-08 17:39 
AnswerRe: The Editbox is working in XP, but it is white in color in Vista! Pin
David Crow14-Nov-08 3:32
David Crow14-Nov-08 3:32 
GeneralRe: The Editbox is working in XP, but it is white in color in Vista! Pin
LaHaHa14-Nov-08 6:06
LaHaHa14-Nov-08 6:06 
AnswerRe: The Editbox is working in XP, but it is white in color in Vista! Pin
Hamid_RT14-Nov-08 8:40
Hamid_RT14-Nov-08 8:40 
QuestionVC++2008 manifest dependencies confusion. Pin
oleg6313-Nov-08 12:03
professionaloleg6313-Nov-08 12:03 
AnswerRe: VC++2008 manifest dependencies confusion. Pin
Saurabh.Garg13-Nov-08 13:52
Saurabh.Garg13-Nov-08 13:52 
GeneralRe: VC++2008 manifest dependencies confusion. Pin
oleg6314-Nov-08 3:43
professionaloleg6314-Nov-08 3:43 
QuestionI do not understand why this compiles Pin
BobInNJ13-Nov-08 11:03
BobInNJ13-Nov-08 11:03 
Please consider the following simply C++ program:

<br />
#include <iostream><br />
#include <cassert><br />
<br />
using namespace std;<br />
<br />
class A {<br />
public:<br />
        int operator ++(int z)<br />
        {<br />
                cout << "++ called with " << z << endl;<br />
                return 5;<br />
        }<br />
        int operator *( int z )<br />
        {<br />
                cout << "* called with " << z << endl;<br />
                return 5;<br />
        }<br />
        int x;<br />
};<br />
<br />
int<br />
main()<br />
{<br />
        A a;<br />
        a.x = 25;<br />
        a ++;<br />
        a * 35 ;<br />
}<br />
<br />


In this case, the class A is defining two operators: ++ and *. For the operator *, I specify only one argument because I expect the first operand to be represented by the this pointer. This works as I would expect. Now for the operator ++. Since this is a unary operator, I would expect the function declaration not to have any arguments. However, it works with one argument. By the way, the expression, a ++ 5 does not compile.

Could somebody please tell me what I am missing?

Bob
AnswerRe: I do not understand why this compiles Pin
Saurabh.Garg13-Nov-08 13:58
Saurabh.Garg13-Nov-08 13:58 
AnswerRe: I do not understand why this compiles Pin
myfavour13-Nov-08 15:43
myfavour13-Nov-08 15:43 
QuestionModeless CPropertySheet - styles [modified] Pin
john john mackey13-Nov-08 9:23
john john mackey13-Nov-08 9:23 
QuestionCryptography with ECDSA from Openssl Pin
misscricri13-Nov-08 4:00
misscricri13-Nov-08 4:00 
QuestionRe: Cryptography with ECDSA from Openssl Pin
led mike13-Nov-08 4:29
led mike13-Nov-08 4:29 
AnswerRe: Cryptography with ECDSA from Openssl Pin
misscricri14-Nov-08 2:44
misscricri14-Nov-08 2:44 
QuestionHow to print string in next line on Edit control Pin
sribachana13-Nov-08 3:13
sribachana13-Nov-08 3:13 
QuestionRe: How to print string in next line on Edit control Pin
David Crow13-Nov-08 3:16
David Crow13-Nov-08 3:16 
AnswerRe: How to print string in next line on Edit control Pin
sribachana13-Nov-08 15:41
sribachana13-Nov-08 15:41 
QuestionRe: How to print string in next line on Edit control Pin
David Crow13-Nov-08 17:36
David Crow13-Nov-08 17:36 
AnswerRe: How to print string in next line on Edit control Pin
voidjinjin13-Nov-08 14:46
voidjinjin13-Nov-08 14:46 
QuestionBrowser plugins question. Pin
rrrado13-Nov-08 2:38
rrrado13-Nov-08 2:38 
QuestionRe: Browser plugins question. Pin
David Crow13-Nov-08 2:44
David Crow13-Nov-08 2:44 
AnswerRe: Browser plugins question. Pin
rrrado13-Nov-08 3:02
rrrado13-Nov-08 3:02 
AnswerRe: Browser plugins question. Pin
Saurabh.Garg13-Nov-08 14:01
Saurabh.Garg13-Nov-08 14:01 
Questionwhich of the buttons is clicked ? Pin
wielklem13-Nov-08 1:08
wielklem13-Nov-08 1:08 
AnswerRe: which of the buttons is clicked ? Pin
CPallini13-Nov-08 2:04
mveCPallini13-Nov-08 2:04 

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.