#include<stdio.h>
#include<string.h>
#include "msp430g2553.h"
void dot(unsigned int d);
void main(void)
{
P1DIR |= 0x01;
char a[] = "string to be entered" ; <--error is : expected a "}"
for(int i = 0;i<sizeof(a);i++) <-- error is: expected a declaration. I've declared i outside and initialized here.But still the error persists
{
switch(a[i])
{
case 'a' :
P1OUT = 0x01;
dot(100);
P1OUT = 0x02;
dot(300);
case 'b' :
dot(100);
case 'c' :
dot(100);
case 'd' :
dot(100);
default :
dot(100);
}
}
}
void dot (unsigned int d )
{
int j,k;
for(k=0;k<d;k++)
for(j=0;j<700;j++);
} <-- warning here is: last line of file ends without a new line