View Single Post
  #6   Spotlight this post!  
Unread 27-01-2010, 00:48
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Function returning a struct

Quote:
Originally Posted by Rafael Vasquez View Post
I am having some issues with structure handling. The error I'm getting reads:

expected initializer before 'function_name'

Here is some sample code for what I'm trying to do:

struct my_struct{
int a;
int b;
};

.....
//This next line is the line in which the error occurs
my_struct function_name(my_struct my_argument){
.....
}

Does anyone have any ideas on what is causing this and how to fix it?
Code:
 struct my_struct fuctionname(struct my_struct argName)
Or you can typedef the struct.
Reply With Quote