Comments (3)
Update 1: I have created a branch 'prog-ex-4.2-solution' to track the progress and the current status of this answer.
I have add the initial template of the answer, in the meantime, as a stub.
from cplusplus-prog-exercises.
TO-DO LIST
- Define a readMatrix() function to read a matrix of size m x n from the keyboard. (Completed in Update 2)
- Define a displayMatrix() function to display the matrix on the screen. (Completed in Update 2)
NOTE: I did a bit of digging into the issue that was preventing me to complete this issue... There are 2 ways for me to approach this problem:
-
By considering 2D array as static where m and n are known at compile time which will make the solution very simple and easy... This would more likely be my course of action, if I find the second approach difficult to implement.
-
By considering 2D array as dynamic where m and n will be given by the user at runtime.. This approach will be a bit more difficult since it uses pointers and concepts of dynamic memory allocation are applied...
In fact, I believe that the first approach is slightly more beginner-friendly but I realised that if I could implement the second approach, at this stage, then, the fear of pointers (which prevents a lot of beginner level learners to continue learning C++) might not be able to grip you (like it did me)..
Pointers and memory management are indeed difficult concepts to master and get comfortable in but these are important hurdles for anyone to overcome, if they need to learn C++ in the true sense..
from cplusplus-prog-exercises.
Update 2: I have completed the answer of this question using the second approach as I mentioned in my TO-DO LIST.
Task(s) Completed:
- Define a readMatrix() function to read a matrix of size m x n from the keyboard.
- Define a displayMatrix() function to display the matrix on the screen.
Hence, this issue is now closed.
P.S: Branch 'prog-ex-4.2-solution' will be deleted after its merged with its base branch.
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.3 still remains unanswered HOT 2
- 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.