forked from andreimargeloiu/UdemyCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataStructuresOne
More file actions
43 lines (36 loc) · 753 Bytes
/
DataStructuresOne
File metadata and controls
43 lines (36 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# include <bits/stdc++.h>
using namespace std;
/*
struct [structure tag]
{
member definition;
member definition;
...
member definition;
} [one or more structure variables](optional);
*/
struct Books
{
char Title[20];
char Author[20];
int ID;
float price;
}book1;
void printingBooks (Books variableBook) {
cout<<variableBook.Author<<"\n";
cout<<"Title is: "<<variableBook.Title<<"\n";
cout<<variableBook.ID<<"\n";
cout<<variableBook.price<<"\n";
}
int main ()
{
book1.ID=10;
book1.price=13.67;
strcpy(book1.Title, "Data structures");
strcpy(book1.Author, "Mark");
printingBooks(book1);
Books book2; // int, floar, char
book2.ID=100;
cout<<book2.ID<<"\n";
return 0;
}