-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path19.Struct.cpp
More file actions
21 lines (19 loc) · 630 Bytes
/
19.Struct.cpp
File metadata and controls
21 lines (19 loc) · 630 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;
//Deklarasi Struct Dengan 4 Member (2x Char 2x Int) Dalam C++
struct game{
const char* nama;
const char* genre;
int sizeGb;
int tahunRilis;
};
int main(){
//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;
}