I want to scan in a string that can take at least 200 characters and then I want to **convert** the string to an `int`, so that I can print it with e.g. `printf("%d", digit)`.

How can I write a function kinda like this I've written here
(this one does not work!):

```
int main()
{

  char car[200];
  int number;
  int i,x;
  int sum = 0;

  printf("Write in number: \n");
  scanf("%c", &car);

  for (i=0; i<200; i++) {

    if (car[i] != '\0') {
      x = car[i]-'0';
      sum = sum + x;

      if (i != 0) {
        sum = sum*10;
      }
    }
  }

  return 0;
}

```