423,850 Members | 1,661 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,850 IT Pros & Developers. It's quick & easy.

<command> expected but found 'int'

P: 1
Trying to write a code in ADS 1.2 but keep getting error C2304E: command expected but found 'unsigned'. Can someone help me? This is the code:

Expand|Select|Wrap|Line Numbers
  1. int main() {
  2.  
  3.     read();
  4.     unsigned char *Img =& current_y[0][0]; //Error C2304E: command expected but found 'unsigned'
  5.     int result = CLAHE (Img,352,288,0,227,2,2,256,3); //Error C2304E: command expected but found 'int'
  6.     printf("%d",result);
  7. }
ANSWERED: I found out the problem. ADS uses an old version of C so you must declare everything first then call the functions used so the main has to look like this:

Expand|Select|Wrap|Line Numbers
  1. int main() {
  2.     unsigned char *Img =& current_y[0][0];
  3.     int result = CLAHE (Img,352,288,0,227,2,2,256,3);
  4.     read();  // executable statements only after declaring variables.
  5.     printf("%d",result);
  6. }
2 Weeks Ago #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.