exercises/ex02/adder.c
void read_inputs(char number[]) {

  printf ("Enter number: ");
  scanf ("%10s", number);

  // Give warning if buffer width is exceeded.
  int i = 0;

  while ((getchar()) != '\n') {

    if (i == 0) {
      printf ("Buffer width exceeded. Some characters have been ignored.\n");
    }

    i=1;
  }
}
/*
  Prompts the user for a number with scanf, and writes up to
  ten characters to a char pointer.

  number: char array to write to
*/
Prompts the user for a number with scanf, and writes up to
ten characters to a char pointer.

char array to write to
Prompts the user for a number with scanf and writes up to ten characters to a char pointer . char array to write to
void read_inputs(char number[]) {
  printf ("Enter number: ");
  scanf ("%10s", number);
  int i = 0;
  while ((getchar()) != '\n') {
    if (i == 0) {
      printf ("Buffer width exceeded. Some characters have been ignored.\n");
    }
    i=1;
  }
}
void read_inputs ( char number [ ] ) { printf ( " " ) ; scanf ( " " , number ) ; int i = 0 ; while ( ( getchar ( ) ) != ' \n ' ) { if ( i == 0 ) { printf ( " \n " ) ; } i = 1 ; } }
Prompts the user for a number with scanf, and writes up to
ten characters to a char pointer.
Prompts the user for a number with scanf and writes up to ten characters to a char pointer .
// Give warning if buffer width is exceeded.