add Chapter06

This commit is contained in:
Amar Mahmutbegovic
2025-05-08 23:01:29 +02:00
parent 7dab196517
commit 0ea2c43f45
8 changed files with 222 additions and 0 deletions

19
Chapter06/rvalue.cpp Normal file
View File

@@ -0,0 +1,19 @@
#include <cstdio>
struct my_struct {
int a_;
my_struct() : a_(0) {}
my_struct(int a) : a_(a) {}
};
int main() {
printf("a_ = %d\r\n", my_struct().a_);
printf("a_ = %d\r\n", (my_struct()=my_struct(16)).a_);
return 0;
}