View Single Post
  #6   Spotlight this post!  
Unread 27-01-2010, 06:00
gvarndell's Avatar
gvarndell gvarndell is offline
Software Engineer
AKA: Addi's and Georgie's Dad
FRC #1629 (GaCo)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Grantsville, Maryland
Posts: 350
gvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond reputegvarndell has a reputation beyond repute
Re: Function returning a struct

Quote:
Originally Posted by Rafael Vasquez View Post
This is a .cpp file. I don't like adding context to questions like these because I am really after more general answers.
Ok, but it's clearly being compiled as C code, and that's why more context would have been helpful.

In your original post, you wrote...

Quote:
I am having some issues with structure handling. The error I'm getting reads:

expected initializer before 'function_name'
In this case, the simple answer is, if the code you posted was compiled as C++, you wouldn't get any such error because 'my_struct' becomes implicitly typedef'd.

Which means, IMHO, you are using a C compiler to teach C++ to others.
__________________
Robots never, ever, ever, ever break -- The Robot Repairman (Backyardigans)

Last edited by gvarndell : 27-01-2010 at 10:35. Reason: grammar
Reply With Quote