Answers for "how to prevent scanf causing a buffer in c"

1

safe scanf c

int main()
{
  char *str = NULL;

  scanf ("%as", &str);
  if (str) {
      printf(""%s"n", str);
      free(str);
  }
  return 0;
}
Posted by: Guest on August-30-2020

Browse Popular Code Answers by Language