<喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+PHByZSBjbGFzcz0="brush:java;">#include
#include
#include //system(); 這個指令需要用到此頭文件
#include //toupper要用到
#include //在內存管理時用到的頭文件
void main()
{
int i;
struct ListEntry {
int number;
struct ListEntry *next;
} start, *node;
start.next = NULL; // Empty list
node = &start; // Point to the start of the list
for (i = 1; i <= 10; i++)
{
node->next = (struct ListEntry *) malloc(sizeof(struct ListEntry));
node = node->next;
node->number = i;
node->next = NULL;
}
// Display the list
node = start.next;
while (node)
{
printf("%d ", node->number);
node = node->next;
}
system("pause");
}