#include <iostream>
#include <string>
class Example {
private:
int m_A;
std::string m_Str;
public:
Example() : m_A(0), m_Str("***") {}
void Print() const {
std::cout << m_A << " " << m_Str << "\n";
}
};
int main() {
Example ex = Example(); // without new = create object on the stack
ex.Print();
// no need to free (delete), the stack will free the object at the end of the scope
}
/*
run:
0 ***
*/