Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
500 B
2
Indexable
Never
#include <iostream>
#include <string.h>
using namespace std;

struct troba {
	int sifra;
	char naziv[100];
	int brojKomada;
};

int main()
{
	troba* roba = new troba;
	roba->sifra = 1093;

	cout << "Uneiste naziv: ";
	
	strcpy(roba->naziv, "Monitor_abc");
	roba->brojKomada = 12;

	troba* kopija = new troba;
	memcpy(kopija, roba, sizeof(roba));

	cout << "Sifra: " << kopija->sifra << endl;
	cout << "Naziv: " << kopija->naziv << endl;
	cout << "Broj komada: " << kopija->brojKomada << endl;

	retur