typedef struct {
int count;
int *items;
}set;
set* set_alloc(set *src, int num);
int set_insert(set *s, int num);
int main() {
set *A = NULL;
A = set_alloc(A, 0);
A = se
我知道還有其他realloc問題和答案噸,我幾乎讀了所有這些,但我仍然無法解決我的問題。 我決定停止嘗試,當我意外地發現我的代碼非常奇怪的行爲。 我引入了一條線來嘗試一些東西,但是雖然我沒有在main中使用newElems的值,但該行改變了行爲。 當該行被註釋時,代碼首先失敗realloc。包括該行,第一個realloc的作品。 (它仍然在第二個崩潰)。 關於可能發生什麼的任何想法? int ma