944,062 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 3918
  • C RSS
Jan 17th, 2006
0

(C) have 2 parse errors (help)

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
zenoen is offline Offline
16 posts
since Dec 2005
Jan 17th, 2006
0

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

need () around if:
if ( any == 0 )

also, you want == not =
Reputation Points: 68
Solved Threads: 18
Posting Pro in Training
winbatch is offline Offline
466 posts
since Feb 2005
Jan 17th, 2006
0

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

try concentrating on { } brackets and matching if-else statements
SpS
Reputation Points: 70
Solved Threads: 32
Posting Pro
SpS is offline Offline
598 posts
since Aug 2005
Jan 18th, 2006
0

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

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; }
Reputation Points: 10
Solved Threads: 1
Newbie Poster
zenoen is offline Offline
16 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Converting a set of numbers seperated by commas...HELP!!!
Next Thread in C Forum Timeline: Problem converting to a double





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC