All pastes #174924 Raw Edit

Miscellany

public c v1 · immutable
·published 2006-09-18 09:49 UTC
rendered paste body
#include <stdio.h>#include <conio.h>#include <stdlib.h>typedef struct nushk{	int info;	nushk* next;}nushk;typedef struct list{	nushk *anchor;};void init_list(list *pushky){	(*pushky).anchor=(nushk*)malloc(sizeof(nushk));	pushky->anchor->next = NULL;}void add_last(list pushky, int x){	nushk *p=pushky.anchor;//æä äàéáø äøàùåï	while (p->next!=NULL){		p=p->next;	}	p->next=(nushk*)malloc(sizeof(nushk));	p=p->next;	p->info=x;	p->next=NULL;}void print(list pushky){	nushk *p2=pushky.anchor;	while (p2->info=!NULL)	printf("%d",p2->info);}void main(){	list moshe;	init_list(&moshe);	int i,y;	scanf("%d",&i);	switch(i){	case 1:scanf("%d",y);		add_last(moshe,y); break;	case 2:print(moshe); break;	}}