(C) have 2 parse errors (help)

Reply

Join Date: Dec 2005
Posts: 16
Reputation: zenoen is an unknown quantity at this point 
Solved Threads: 1
zenoen zenoen is offline Offline
Newbie Poster

(C) have 2 parse errors (help)

 
0
  #1
Jan 17th, 2006
here is my problem
main.c:17: error: parse error before '{' token
main.c:27: error: parse error before string constant


  1. #include <stdio.h>
  2. #include <c.h>
  3. #include <math.h>
  4. #include <ctype.h>
  5. #include <time.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8.  
  9. #define kmll 200
  10. #define Kzll 0
  11.  
  12. int myint,any,go;
  13. int main (int argc, const char * argv[]) {
  14.  
  15. (myint, any, go) = 0 ;
  16.  
  17. // here parse error
  18. do printf(" helo guys plese incert a number") {
  19.  
  20. if any = 0 {
  21.  
  22. scanf("%c %c",myint,any);
  23.  
  24. else
  25.  
  26. printf(" next code"); }
  27.  
  28. // here parse error
  29. printf(" %d + %d = %d ", myint, any,(any + myint));
  30.  
  31. else printf(" uno");
  32.  
  33. return 0; }

a quick reply to the problem would be helpfull
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 466
Reputation: winbatch is on a distinguished road 
Solved Threads: 18
winbatch's Avatar
winbatch winbatch is offline Offline
Posting Pro in Training

Re: (C) have 2 parse errors (help)

 
0
  #2
Jan 17th, 2006
need () around if:
if ( any == 0 )

also, you want == not =
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: (C) have 2 parse errors (help)

 
0
  #3
Jan 17th, 2006
try concentrating on { } brackets and matching if-else statements
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 16
Reputation: zenoen is an unknown quantity at this point 
Solved Threads: 1
zenoen zenoen is offline Offline
Newbie Poster

Re: (C) have 2 parse errors (help)

 
0
  #4
Jan 18th, 2006
still doesent work please help

  1. #include <stdio.h>
  2. #include <c.h>
  3. #include <math.h>
  4. #include <ctype.h>
  5. #include <time.h>
  6. #include <stdlib.h>
  7. #include <string.h>
  8.  
  9. #define kmll 200
  10. #define Kzll 0
  11.  
  12. int myint,any,go;
  13. int main (int argc, const char * argv[]) {
  14.  
  15. (myint, any, go) == 0 ;
  16.  
  17.  
  18.  
  19. // stupid error is some where under here ( parse error befor '{' token )
  20. //help it should work but doesent
  21. /*dang it */ do printf(" helo guys plese incert a number "); {
  22.  
  23.  
  24. while any = 0 {
  25.  
  26. scanf("%c %c",myint,any);
  27.  
  28. else
  29.  
  30. printf(" next code"); }
  31.  
  32.  
  33. // here 2 im in need of help (parse error befor string constant)
  34. // i don't see the problem help me
  35. printf(" %d + %d == %d ", myint, any,(any + myint));
  36.  
  37.  
  38. else printf(" uno"); }
  39.  
  40. return 0; }
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
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