stdlib

Dependencies:   mbed

main.cpp

Committer:
sherckuith
Date:
2012-04-03
Revision:
0:3aa31e7fe98c

File content as of revision 0:3aa31e7fe98c:

#include "mbed.h"

/* atoi example */
#include <stdio.h>
#include <stdlib.h>

int main ()
{
  int i;
  char szInput [256];
  printf ("Enter a number: ");
  fgets ( szInput,5, stdin );//char * fgets ( char * str, int num, FILE * stream );
  i = atoi (szInput);
  printf ("The value entered is %d. The double is %d.\n",i,i*2);
  return 0;
}