3 Replies - 185 Views - Last Post: 09 February 2013 - 01:11 PM Rate Topic: -----

#1 Thanos_1983  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 05-February 13

Compiling error? or code error?

Posted 09 February 2013 - 12:12 PM

Hello everyone,

I hope that someone can help with my question. I have this command:

 
first.size = (memory[3] & 0xFF) | (memory[2] & 0xFF) << 7 ) | ((memory[1] & 0xFF) << 14 ) | ((memory[0] & 0xFF) << 21 );



Yesterday was compiling perfectly and there was no problems or warnings today that I modify the program it comes with these errors:

task1c.c:111:64: error: expected ‘;’ before ‘)’ token
task1c.c:111:64: error: expected statement before ‘)’ token
task1c.c:111:66: error: expected expression before ‘|’ token

How is this possible? The code is very simple and it should not have a problem to run.

Thanks in advance for any suggestions on my problem.

Best Regards,
Thanos

This post has been edited by ButchDean: 09 February 2013 - 01:10 PM
Reason for edit:: corrected code tags.


Is This A Good Question/Topic? 0
  • +

Replies To: Compiling error? or code error?

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Compiling error? or code error?

Posted 09 February 2013 - 12:21 PM

You have two extra left parenthesis!
Was This Post Helpful? 1
  • +
  • -

#3 Thanos_1983  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 05-February 13

Re: Compiling error? or code error?

Posted 09 February 2013 - 12:30 PM

Thanks a lot for your immediate replied to my need, you where absolutely right about the parenthesis so small mistake that I could not notice. But I was missing one parenthesis not extra, the code is like this:
[/ first.size = (memory[3] & 0xFF) |
((memory[2] & 0xFF) << 7 ) |
((memory[1] & 0xFF) << 14 ) |
((memory[0] & 0xFF) << 21 );]
It is easier to read now.

Thanks a lot you saved me from spending not useful hours looking at the code an try to understand what was wrong.
Was This Post Helpful? 0
  • +
  • -

#4 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Compiling error? or code error?

Posted 09 February 2013 - 01:11 PM

No problem. With those sort of errors always check your parenthesis are balanced.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1