Dev C++
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Lista prvi primer

Go down

Lista prvi primer  Empty Lista prvi primer

Post  Don Corleone Wed Apr 13, 2011 11:50 pm

#include<stdio.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>

typedef char TIP;
typedef struct cvor_st{
TIP inf;
struct cvor_st *sledeci;
} LCVOR;
//funkcija za pisanje
void pisi(LCVOR *tekuci){
while(tekuci!=NULL){
printf("->%c",tekuci->inf);
tekuci=tekuci->sledeci;
}
}

int main(){
LCVOR *pocetak_liste,*novi;
char ch;
//pocetak liste je prazan
pocetak_liste=NULL;
printf("\n Unesi sadrzaj liste:\n");

while((ch=getchar())!='\n')
{
novi=(LCVOR *)malloc(sizeof(LCVOR));
novi->inf=ch;
novi->sledeci=pocetak_liste;
pocetak_liste=novi;
}
printf("Sadrzaj liste je:\n");
pisi(pocetak_liste);
getch();
}
Don Corleone
Don Corleone
Admin

Posts : 148
Join date : 2009-10-28
Age : 31
Location : Sombor - Serbia

https://programing.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum