【发布时间】:2020-10-27 22:35:59
【问题描述】:
我已经搜索并没有真正找到并理解这个错误。奇怪的是,我只得到 c、d、e 的错误,而不是 a 和 b 或它们所有的错误。
节目是关于双链表的。
当我编译时会发生这种情况:
gcc -Wall -g -c program.c
错误部分:
void try_mymem(int argc, char** argv) {
strategies strat;
void *a, *b, *c, *d, *e;
if (argc > 1)
strat = strategyFromString(argv[1]);
else
strat = First;
/* A simple example.
Each algorithm should produce a different layout. */
initmem(strat, 500);
a = mymalloc(100);
b = mymalloc(100);
c = mymalloc(100);
myfree(b);
d = mymalloc(50);
myfree(a);
e = mymalloc(25);
print_memory();
print_memory_status();
}
我做错了什么?
【问题讨论】:
标签: c ubuntu linked-list doubly-linked-list