mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-04-05 11:41:28 +08:00
update
This commit is contained in:
13
codingStyleIdioms/3_RAII/c++_example.cpp
Normal file
13
codingStyleIdioms/3_RAII/c++_example.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by light on 19-12-12.
|
||||
//
|
||||
#include <iostream>
|
||||
int main() {
|
||||
std::string str = std::string ("toptal");
|
||||
std::cout << "string object: " << str << " @ " << &str << "\n";
|
||||
|
||||
str += ".com";
|
||||
std::cout << "string object: " << str << " @ " << &str << "\n";
|
||||
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user