Return to Snippet

Revision: 35844
at November 14, 2010 10:29 by KHAAAANNN


Initial Code
struct automobil{
	char marka[20];				
	char model[20];				
	int serijskibroj;								 	
	int godina;				
};

struct tstog{
	automobil vrijednost;			
	tstog *sljedeci;			
};				

typedef struct tstog *pstog;		
				
automobil TopS(tstog *St){
	tstog *vrh = St->sljedeci;		
	if (St->sljedeci == NULL) 	 
	{
		automobil au;		
		au.serijskibroj = 0;	
		au.godina = 0;			
		return au;
	}
	else
		return vrh->vrijednost;	
}//TopS

void PushS(automobil x, tstog *St){
	tstog *novi;
	novi = new tstog;		
	novi->vrijednost = x;			
	novi->sljedeci = St->sljedeci;		
	St->sljedeci = novi;		
}

void PopS(tstog *St){
	tstog *vrh = St->sljedeci;		
	St->sljedeci = vrh->sljedeci;
	delete vrh;	
}

void InitS(tstog *St){						
	St->sljedeci = NULL;		 					
}

bool IsEmptyS(tstog *St){
	if (St->sljedeci == NULL)		
		return true;			
	else
		return false;			
}

Initial URL


Initial Description


Initial Title
stog_pokazivac.h

Initial Tags


Initial Language
C++