Comments (2)
Update 1:
Things that I have achieved in this update:
- Created a constructor which allocates the desired memory to the members using 'new' operator.
- Populated the members with data.
NOTE:
Even though I have uploaded this update, there are some areas/ concerns with this code that I want to draw your attention...
-
First, is the use of C-style arrays i.e, char arrays or char*... In modern C++, especially if you are using a C++ compiler based on C++11 or C++14 standard (or a later standard), it is highly recommended to use the std::string container to deal with string or multi-character based data...
-
Second, even though, I have used 'new' (since, it was mentioned in the question), I will also need to
define a destructor to deallocate the memory that has been allocated to the members... But, again, this
complicates the situation since the responsibility of dealing with releasing the memory and preventing
situations like memory leaks fall on our shoulders...Hence, only use 'new' when it is absolutely necessary (or, in situations, when the question has
explicitly mentioned to use it..) The program is working fine and it is terminating properly (hence, I feel
that the code is freeing the memory properly, but again, be careful while using new and delete).
from cplusplus-prog-exercises.
Update 2:
The answer to this question is complete and hence, this issue is now 'closed'.
from cplusplus-prog-exercises.
Related Issues (20)
- Question 9.4 still remains unanswered. HOT 2
- Question 6.2 still remains unanswered HOT 1
- Question 6.4 still remains unanswered HOT 3
- Question 6.5 still remains unanswered HOT 2
- Question 7.1 still remains unanswered
- Question 7.2 still remains unanswered
- Question 7.3 still remains unanswered HOT 14
- Question 7.4 still remains answered HOT 4
- Question 7.5 still remains unanswered HOT 2
- Question 8.1 still remains unanswered HOT 4
- Question 8.2 still remains unanswered HOT 4
- Question 8.3 still remains unanswered HOT 12
- Question 8.4 still remains unanswered HOT 3
- Question 8.5 still remains unanswered HOT 3
- Question 8.6 still remains unanswered HOT 1
- Question 8.7 still remains unanswered HOT 1
- Question 9.1 still remains unanswered. HOT 3
- Question 9.2 still remains unanswered. HOT 3
- Question 9.3 still remains unanswered. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cplusplus-prog-exercises.