Can't simulate this on code warrior help plz!!!!!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't simulate this on code warrior help plz!!!!!

Jump to solution
1,623 Views
A_Al_Shaybani
Contributor I
can any one help to to correct the problem in this code it is simple but i can't run it:smileysad: 
 
 
this is the code:
 
#include <hidef.h>      /* common defines and macros */
#include "derivative.h"      /* derivative-specific definitions */
#pragma LINK_INFO DERIVATIVE "mc9s12dg256"



char Addit( char, char);


void main(void) {
 char x,y,z;
 
 x=5;
 y=6;
 z= Addit (x,y);
 

EnableInterrupts;

  for(; ; ) {}

  char Addit (char a, char b); { 
  return (a+b);
}
 
And im using CodeWarrior for S12(X) Microcontrollers V5.0

Message Edited by A.Al-Shaybani on 2009-10-16 01:44 PM
Message Edited by A.Al-Shaybani on 2009-10-16 01:45 PM
Labels (1)
Tags (1)
0 Kudos
1 Solution
577 Views
kef
Specialist I
Of course. You should remove extra ;
char Addit (char a, char b);
  return (a+b);
}

View solution in original post

0 Kudos
4 Replies
577 Views
A_Al_Shaybani
Contributor I

 

See this is what i got after adding } 

 

ERROR

 

 

0 Kudos
578 Views
kef
Specialist I
Of course. You should remove extra ;
char Addit (char a, char b);
  return (a+b);
}
0 Kudos
577 Views
A_Al_Shaybani
Contributor I
Thank you very much 
0 Kudos
577 Views
kef
Specialist I

Missing }, see below:

 

char Addit( char, char);


void main(void) {
 char x,y,z;
 x=5;
 y=6;
 z= Addit (x,y);

EnableInterrupts;

  for(; ; ) {}
}

char Addit (char a, char b); { 
  return (a+b);
}
0 Kudos