C Program Compiles in Dev-C++ but not GCC?

Thread Solved

Join Date: Sep 2009
Posts: 17
Reputation: Kombat is an unknown quantity at this point 
Solved Threads: 0
Kombat Kombat is offline Offline
Newbie Poster

C Program Compiles in Dev-C++ but not GCC?

 
0
  #1
Sep 18th, 2009
p1a.c: In function `main':
p1a.c:20: parse error before `char'
p1a.c:46: parse error before `char'
p1a.c:47: `result' undeclared (first use in this function)
p1a.c:47: (Each undeclared identifier is reported only once
p1a.c:47: for each function it appears in.)
p1a.c:47: `basechars' undeclared (first use in this function)
Last edited by Kombat; Sep 18th, 2009 at 2:23 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: C Program Compiles in Dev-C++ but not GCC?

 
0
  #2
Sep 18th, 2009
Standard C doesn't allow you to declare variables in the middle of statement blocks.
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 17
Reputation: Kombat is an unknown quantity at this point 
Solved Threads: 0
Kombat Kombat is offline Offline
Newbie Poster

Re: C Program Compiles in Dev-C++ but not GCC?

 
0
  #3
Sep 18th, 2009
got it thanks
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC