一種防止這種情況的方法是使用 snprintf() ,它將字串截斷為您提供的最大長度。 char *x = malloc(5 * sizeof(char)); int size = snprintf(x, 5, ...
確定! 回上一頁