我在c中有此结构
struct node{
int info;
struct node* link;
};
此过程:
void example(struct node** head){
struct node* tmp;
tmp=*head;
tmp->info=0;
*head=tmp;
}
并使用]调用主过程>
example(&head);
所以要修改head-> info,我需要一个支持变量,还有没有支持变量的另一种方法吗?
我在c struct node {int info;中有这个结构; struct node *链接; };这个过程:void example(struct node ** head){struct node * tmp; tmp = * head; tmp-> info = 0; * head = tmp; ...
使用此:
如果您有一个指向像这样声明的对象的指针>
struct node *head;
head = malloc( sizeof( struct head ) );