- Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path19.Struct.cpp
More file actions
Latest commit
19 lines (19 loc) · 628 Bytes
/
Copy path19.Struct.cpp
File metadata and controls
19 lines (19 loc) · 628 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<iostream>
usingnamespacestd;
//Deklarasi Struct Dengan 4 Member (2x Char 2x Int) Dalam C++
structgame{
constchar* nama;
constchar* genre;
int sizeGb;
int tahunRilis;
};
intmain(){
//membuat struct layaknya Constructor Pada Paradigma OOP
game GTAV = {"Grand Theft Auto V","Open-World,Action,Shooter",58,2013};
//Output Dari Setiap Member Value Struct
cout<<"\t\t+++++ Game +++++"<<endl;
cout<<"Nama \t\t:\t"<<GTAV.nama<<endl;
cout<<"Genre \t\t: \t"<<GTAV.genre<<endl;
cout<<"Size (GB) \t: \t"<<GTAV.sizeGb<<endl;
cout<<"Tahun Rilis \t: \t"<<GTAV.tahunRilis<<endl;
}