Initial commit

This commit is contained in:
Michael Reber
2019-11-15 12:59:38 +01:00
parent 40a414d210
commit b880c3ccde
6814 changed files with 379441 additions and 0 deletions
@@ -0,0 +1,34 @@
Demonstrates the use of structure in C++.
Stores some personal data in a structure, then prints the info out.
#include <iostream>
using namespace std;
int main()
{
// Defining a structure
struct PersonalData
{
char *FirstName;
char *LastName;
char *Birthday; // in the format of 12/27/1978
int PhoneNum;
}; // don't forget the ending ";"
// Declaring a variable of type PersonalData
PersonalData PersonOne;
// Populate PersonOne with data
PersonOne.FirstName = "Kyra";
PersonOne.LastName = "Red";
PersonOne.Birthday = "12/27/1978";
PersonOne.PhoneNum = 5855555;
// Print the data out
cout << "PersonOne's First name is: " << PersonOne.FirstName << endl;
cout << "PersonOne's Last name is: " << PersonOne.LastName<< endl;
cout << "PersonOne's Birthday is: " << PersonOne.Birthday<< endl;
cout << "PersonOne's Phone number is: " << PersonOne.PhoneNum<< endl;
return 0;
}