Add test program to test static variable lookups.

This commit is contained in:
Ernie Pasveer
2022-08-11 18:31:32 -05:00
parent 84b8f0cb31
commit 7097dd6396
5 changed files with 59 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#include <string>
#include <iostream>
#include <string.h>
struct Location {
std::string city;
std::string state;
int zip;
};
struct Person {
std::string name;
int age;
float salary;
struct Location location;
};
static Person me;
int main (int argc, char** argv) {
me.name = "Pasveer, Ernie";
me.age = 60;
me.salary = 0.25;
me.location.city = "Houston";
me.location.state = "Texas";
me.location.zip = 77063;
std::cout << "'" << me.name << "', from '" << me.location.city << "', is " << me.age << " years old and makes " << me.salary << " per year." << std::endl;
return 0;
}