Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- struct Masina
- {
- char marca[20] = "";
- char culoare[20] = "";
- int cai_putere;
- } m1, m2;
- int main()
- {
- strcpy(m1.marca, "Audi");
- strcpy(m1.culoare, "Negru");
- m1.cai_putere = 400;
- strcpy(m2.marca, "Opel");
- strcpy(m2.culoare, "Alb");
- m2.cai_putere = 300;
- cout << m1.marca << endl;
- cout << m1.culoare << endl;
- cout << m1.cai_putere << endl << endl;
- cout << m2.marca << endl;
- cout << m2.culoare << endl;
- cout << m2.cai_putere << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment