mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Add test program to test static variable lookups.
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
|
||||
# Seer Change Log
|
||||
|
||||
## [1.9beta] - 2022-MM-DD
|
||||
* Add history (up/down arrows) to all line input fields.
|
||||
- Variable logger, tracker browsers.
|
||||
- Source, function, types, variable, library browsers.
|
||||
- Struct, memory, array visualizers.
|
||||
- Console.
|
||||
|
||||
## [1.8] - 2022-08-08
|
||||
|
||||
* Add StructVisualizer
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
hellostatic
|
||||
core*
|
||||
@@ -0,0 +1,14 @@
|
||||
# This is the default target, which will be built when
|
||||
# you invoke make
|
||||
.PHONY: all
|
||||
all: hellostatic
|
||||
|
||||
# This rule tells make how to build hellostatic from hellostatic.cpp
|
||||
hellostatic: hellostatic.cpp
|
||||
g++ -g -o hellostatic hellostatic.cpp
|
||||
|
||||
# This rule tells make to delete hellostatic and hellostatic.o
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f hellostatic hellostatic.o
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Simple program to use a C/C++ static
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user