Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication8.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- struct let
- {
- char* nazivLeta;
- let* sljedeci;
- };
- void DodajNaPocetakListe(char _nazivLeta[], let* lista)
- {
- let* temp = new let;
- temp->nazivLeta = new char[strlen(_nazivLeta) + 1];
- strcpy_s(temp->nazivLeta, strlen(_nazivLeta) + 1, _nazivLeta);
- temp->sljedeci = lista;
- lista = temp;
- }
- void IspisListe(let* lista)
- {
- if (lista == nullptr)return;
- cout << lista->nazivLeta;
- IspisListe(lista->sljedeci);
- }
- int main()
- {
- let* lista = nullptr;
- DodajNaPocetakListe("Sarajevo", lista);
- IspisListe(lista);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement