02-03-2019, 06:07 PM
OK for that.
so more code:
typedef struct node {
int val;
struct node * next;
} node_t;
type node int'val node*next
is there a way to have typedef like in code to define node_t? could not find it.....
The second problem is that C linked lists rely heavily on while/do while statements
But there are no "while" in QM, only rep.
void print_list(node_t * head) {
node_t * current = head;
while (current != NULL) {
printf("%d\n", current->val);
current = current->next;
}
}
i did:
#sub AfficherListe
function Liste*P <===no typedef
if(P==0) ret
Node* actuel=P.premier
rep
if(actuel==0)
break
out actuel.nombre
actuel=actuel.suivant
is this correct?
so more code:
typedef struct node {
int val;
struct node * next;
} node_t;
type node int'val node*next
is there a way to have typedef like in code to define node_t? could not find it.....
The second problem is that C linked lists rely heavily on while/do while statements
But there are no "while" in QM, only rep.
void print_list(node_t * head) {
node_t * current = head;
while (current != NULL) {
printf("%d\n", current->val);
current = current->next;
}
}
i did:
#sub AfficherListe
function Liste*P <===no typedef
if(P==0) ret
Node* actuel=P.premier
rep
if(actuel==0)
break
out actuel.nombre
actuel=actuel.suivant
is this correct?
