What is the difference between CRect c; and CRect c (); when is CRect a class?

What is the difference between CRect c; and CRect c () when CRect is a class?

+3


source to share


2 answers


This

CRect c;

      

creates an object CRect

named c

.



This

CRect c();

      

declares a function with a name c()

that returns an object CRect

. This is an analysis, which is annoying, but not the most unpleasant of them all .

+6


source


CRect c; 

      

defines an object

CRect c(); 

      



declares that the function returns an object CRect

.

Sometimes people are unaware of the second form and fall into the most nasty parsing.

+6


source







All Articles