Just wanting to see how you guys view this, but as far as I understand, a constructor for a class is only used to initialize variables.
Is this true? THanks
Just wanting to see how you guys view this, but as far as I understand, a constructor for a class is only used to initialize variables.
Is this true? THanks
>a constructor for a class is only used to initialize variables
What about a shared resource manager that puts a lock on the resource in the constructor and unlocks it in the destructor? The constructor may or may not initialize data members, but also does other work.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.