Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct torte {
- char naziv[20];
- float cijena;
- char narucio[20];
- };
- int main()
- {
- // inicijalizacija varijable torta1, sa atributima naziv, cijena, narucio
- torte torta1;
- // atribudi objekta torta1
- strcpy_s(torta1.naziv, "Monte");
- torta1.cijena = 30;
- strcpy_s(torta1.narucio, "Muris Zivojevic");
- torte torta2;
- torta2 = { "Crnac sa jajima", 50, "Amer Rafa Halilovic" };
- // ispis
- cout << "Torta 1\n__________________________________\n";
- cout << "Naziv torte: \t\t"<< torta1.naziv << endl;
- cout << "Cijena torte: \t\t" << torta1.cijena << " KM"<< endl;
- cout << "Narucioc torte: \t" << torta1.narucio << endl<<endl<<endl;
- cout << "Torta 2\n__________________________________\n";
- cout << "Naziv torte: \t\t" << torta2.naziv << endl;
- cout << "Cijena torte: \t\t" << torta2.cijena << " KM" << endl;
- cout << "Narucioc torte: \t" << torta2.narucio << endl;
- system("pause >nul");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment