[cs13001] Classes Slide Set

Mikhail Nesterenko mikhail at cs.kent.edu
Sun Apr 6 10:53:50 EDT 2014


> As I was carefully working through the classes slide set I saw this on
> slide 9:
> 
> what is this:  Date mybday();
> 
> Well after investigating and working with my lab instructor we are still
> not sure.  With this object declaration in a test program the code compiles
> fine.  We compiled in both Visual Studio 2012 and using gcc on Neptune.  So
> the declaration seems syntactically correct.  However, at the same time it
> does not appear that the object is even actually created when the program
> is executed.  When stepping through the code using the debugger it appears
> that this declaration statement is just skipped and we definitely do not
> see the object get created.
> 
> Is this what is happening, it is an invalid object declaration (because of
> the empty parentheses) so it is just skipped at run time?

It is a prototype of a function that returns an object of class Date.

thanks,
--
Mikhail


More information about the cs13001 mailing list