This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unconventional Class Assignment Behavior ?


Jason White <whitewaterssoftwareinfo@gmail.com> writes:

> Hello, recently I have been experiencing difficulties on class
> assignment (see program
>  below). I cannot compile the program below* which seems odd to me
> since the code
> is perfectly valid. Any advice on fixing this would be appreciated.
>
> error: request for member âloadâ in âengine1â, which is of non-class
> type âgame_engine()â|
>
> *   main.c: http://pastebin.com/fa5KsbT1
>     game_engine.h: http://pastebin.com/xdQsPHCf
>     game_engine.c: not posted

I bet that error message had a file name and a line number.  You should
tell us that too.

In this case it seems straightforward enough.  When you write
    game_engine engine1();
you are declaring a function named engine1 which takes no arguments and
returns a value of type game_engine.

See http://en.wikipedia.org/wiki/Most_vexing_parse .

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]