LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-02-2010, 04:16 PM   #1
pppwww
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Rep: Reputation: 0
line 11: error: expected ':', ',', ';','}' or '_attribute_' before '}' token


Hi,

I worte some code, but I got error for complier.

Code is :
#include <stdio.h>

#include <stdlib.h>

#include <time.h>

#include <string.h>

#include <ctype.h>



typedef struct FederalFraudvillian {

char *party;

char *s;

void partyLine(char *pp, char *ss)
line 11 {

printf(pp, ss);

printf("\n");

}

}federalFraudvillian;

Someone can help me.

Thanks!
 
Old 02-02-2010, 05:02 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
It's a long time since I did C, but I'm pretty sure you can't put a function inside a struct; struct is a data structure, not code.
 
Old 02-02-2010, 06:00 PM   #3
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,229

Rep: Reputation: 173Reputation: 173
Code:
void partyLine(char *pp, char *ss)
line 11 {
Whats that line 11 for?
 
Old 02-02-2010, 06:57 PM   #4
pppwww
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chrism01 View Post
It's a long time since I did C, but I'm pretty sure you can't put a function inside a struct; struct is a data structure, not code.
You are right!

Thank you very much!
 
Old 02-02-2010, 07:06 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
@smeezekitty : 'Line 11' denotes the line the compiler complained about; see the orig question text.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compile error: expected ; before * token osc~ Linux - Software 12 12-10-2009 11:18 AM
ERROR MESSAGE: ' Expected class name before ',' token. biplabbijay Programming 6 11-18-2009 10:26 PM
expected unqualified-id before { token in C knobby67 Programming 3 04-25-2009 04:11 AM
C compiling error: expected expression before { token CoderMan Programming 3 03-31-2009 04:31 PM
compile error: expected ; before * token osc~ Linux - Software 2 12-05-2008 08:52 AM


All times are GMT -5. The time now is 07:08 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration