Ad
  • Custom User Avatar

    sizeof(n) - returns the number of bytes, does not return count of numbers
    you have char *str = malloc(2 * 4);

    and if you use malloc, always use free(str) at the end

    Goodluck!!