2
This commit is contained in:
		
							parent
							
								
									1fe8245bf7
								
							
						
					
					
						commit
						f7aaa7d7f8
					
				@ -1,7 +1,23 @@
 | 
				
			|||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
#ifndef TRAIN_H
 | 
					#ifndef TRAIN_H
 | 
				
			||||||
#define TRAIN_H
 | 
					#define TRAIN_H
 | 
				
			||||||
#define SIZE 100
 | 
					#define SIZE 100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Jeden vozen vlaku
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					struct car {
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Nazov cielovej  stanice
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    char value[SIZE];
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Smenik na dalsi vozen
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    struct car* next;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct car* add_car(struct car* first, const char* target) {
 | 
					struct car* add_car(struct car* first, const char* target) {
 | 
				
			||||||
    // Vytvorenie noveho vozna
 | 
					    // Vytvorenie noveho vozna
 | 
				
			||||||
@ -29,15 +45,7 @@ struct car* add_car(struct car* first, const char* target) {
 | 
				
			|||||||
    // Pridanie noveho vozna na koniec
 | 
					    // Pridanie noveho vozna na koniec
 | 
				
			||||||
    temp->next = new_car;
 | 
					    temp->next = new_car;
 | 
				
			||||||
    return first;
 | 
					    return first;
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * Prida vozen na koniec vlaku.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * @arg nazov cielovej stanice, ktory sa ma priradit novemu voznu.
 | 
					 | 
				
			||||||
 * @return smernik na zaciatok vlaku.
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
struct car* add_car(struct car* first,const char* target);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user