Files
seer/tests/hellostruct/hellostruct.cpp
T

36 lines
732 B
C++
Raw Normal View History

#include <string>
#include <iostream>
#include <string.h>
2022-08-06 17:06:39 -05:00
struct Location {
2022-08-21 15:53:35 -05:00
std::string city;
std::string state;
int zip;
2022-08-06 17:06:39 -05:00
};
struct Person {
2022-08-21 15:53:35 -05:00
std::string name;
int age;
float salary;
struct Location location;
};
int main (int argc, char** argv) {
Person me;
2022-08-06 17:06:39 -05:00
me.name = "Pasveer, Ernie";
me.age = 60;
me.salary = 0.25;
me.location.city = "Houston";
me.location.state = "Texas";
me.location.zip = 77063;
2022-08-06 17:06:39 -05:00
std::cout << "'" << me.name << "', from '" << me.location.city << "', is " << me.age << " years old and makes " << me.salary << " per year." << std::endl;
return 0;
}