This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Scanf statement

Hi all,

I am trying to get an integer number as input through serial window.To do that I wrote the program below and it didnt work.The problem is with Scanf.Is it correct to give scanf the way that i have given in my program....
when i treid to build i got the following error


#include <stdio.h>
#include <LPC21xx.H>

void main (void)
{
	int a;
  	int b;
  	int c;



/* initialize the serial interface   */
PINSEL0 = 0x00050000;         /* Enable RxD1 and TxD1                     */
U1LCR = 0x83;                   /* 8 bits, no Parity, 1 Stop bit            */
  U1DLL = 97;                     /* 9600 Baud Rate @ 15MHz VPB Clock         */
  U1LCR = 0x03;                   /* DLAB = 0                                 */



  printf ("Enter the value of a b c\n");
  scanf ("%d %d %d", &a, &b, &c);

   }
 

Error


*** ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: getchar?T
MODULE: C:\KEILARM\ARM\LIB\CAL.LIB (getchar)
DEFINED: .\Obj\Serial.obj (Serial)
*** WARNING L23: UNRESOLVED EXTERNAL SYMBOLS
Program Size: data=1172 const=52 code=270
Target not created


looking for ur help