diff options
author | Oskar <[email protected]> | 2024-10-03 12:20:34 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-10-03 12:20:34 +0200 |
commit | 2f1ad9ec273a0ff9e746e9f6c4cac2ce81cb31e4 (patch) | |
tree | a397e770261ea84eedbea851fd051210246f4a10 /7p58.cpp | |
parent | 3edb35c6cab27d36f0fde49726db8cc9289e7304 (diff) |
small test to play around abit with classes
Diffstat (limited to '7p58.cpp')
-rw-r--r-- | 7p58.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/7p58.cpp b/7p58.cpp new file mode 100644 index 0000000..ac94db8 --- /dev/null +++ b/7p58.cpp @@ -0,0 +1,38 @@ +#include <iostream> +#include <vector> + +/* + * + * 7.58 + * + * + */ + +class Example { +public: + static double rate; // Cannot be initialized here + static const int vecSize = 20; + static std::vector<double> vec; // Cannot be initialized here +}; + +// We initialize them here instead +double Example::rate = 20; +std::vector<double> Example::vec(vecSize); +int main () { + + /* + // example.h + class Example { + public: + static double rate = 6.5; + static const int vecSize = 20; + static vector<double> vec(vecSize); + }; + + // example.C + #include "example.h" + double Example::rate; + vector<double> Example::vec; + */ + return 0; +} |