Giter VIP home page Giter VIP logo

Comments (3)

SuyashD95 avatar SuyashD95 commented on August 16, 2024

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.

SuyashD95 avatar SuyashD95 commented on August 16, 2024

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:

  1. 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.

  2. 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.

SuyashD95 avatar SuyashD95 commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.