diff options
author | Oskar <[email protected]> | 2024-07-30 17:01:04 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-07-30 17:01:04 +0200 |
commit | 642720852ec17b68d8d2bbad300202604c0bb63d (patch) | |
tree | 5cdb770d6a871f90a3511bd4b885b6499cffd534 /const-tests.cpp | |
parent | 7aac5c6dc29079971a5c964762cdb294782b14d5 (diff) |
more exercises
Diffstat (limited to 'const-tests.cpp')
-rw-r--r-- | const-tests.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/const-tests.cpp b/const-tests.cpp new file mode 100644 index 0000000..6f07b05 --- /dev/null +++ b/const-tests.cpp @@ -0,0 +1,25 @@ +#include <iostream> +#include "sales_item.hpp" + +/* + * + * Just me testing a bit + * + * + */ + +int main () { + + int i = 10; + const int *p = &i; + const int ci = 42; + const int &r = ci; + const int &r2 = i; + std::cout << *p << " " << i << std::endl; + std::cout << r << std::endl; + i = 20; + std::cout << *p << " " << i << std::endl; + i = 3443; + std::cout << r2 << std::endl; + return 0; +} |