I'm getting "Invalid Initializer", what is the mistake I'm making?

Viewed 35

I am trying to receive string through serial communication. but I get the error "invalid initializer". what could be the mistake I have done??

int main{
//more codes here
  while(1){
  //more codes here
     unsigned char mssg[] = USART_RXchar();
  }
  return 0;
}


unsigned char USART_RXchar(void){
    while ((UCSRA & (1 << RXC)) == 0);
return(UDR);
}
1 Answers

You should have use "int main(){//code here}

Related