diff options
author | Oskar <[email protected]> | 2024-07-31 17:09:45 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-07-31 17:09:45 +0200 |
commit | a450487a18ec72ea3a3815bfaf17b2f701796b6f (patch) | |
tree | 67b4cfe127bc5c134f06c06e57ad35629e630b7b /2p33-2p34.cpp | |
parent | b7819b597e1241dd98643eeda4c288a341142311 (diff) |
more
Diffstat (limited to '2p33-2p34.cpp')
-rw-r--r-- | 2p33-2p34.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/2p33-2p34.cpp b/2p33-2p34.cpp new file mode 100644 index 0000000..bc16416 --- /dev/null +++ b/2p33-2p34.cpp @@ -0,0 +1,47 @@ +#include <iostream> +#include "sales_item.hpp" + +/* + * + * 2.33, 2.34 + * + * + */ + +int main () { + + int i = 0, &r = i; + const int ci = i, &cr = ci; + + auto a = r; // int + auto b = ci; // int + auto c = cr; // int + auto d = &i; // int * + auto e = &ci; // const int * + const auto f = ci; // const int + auto &g = ci; // const int & + std::cout << a << " " << b << " " << c << " " << d << " " + << e << " " << f << " " << g << std::endl; + + a = 42; // valid + std::cout << a << std::endl; + + b = 42; // valid + std::cout << a << std::endl; + + c = 42; // valid + std::cout << a << std::endl; + + //d = 42; // inValid + //std::cout << a << std::endl; + + //e = 42; // inValid + //std::cout << a << std::endl; + + //f = 42; // inValid + //std::cout << a << std::endl; + + //g = 42; // inValid + //std::cout << a << std::endl; + return 0; +} |