Question: How to make a command line argument and use input to make a dynamic array in C++ Hi all, I need help coding a command

How to make a command line argument and use input to make a dynamic array in C++ Hi all, I need help coding a command line argument that accepts two parameters the first one is the name of my program and the next is an integar for number of players and then uses that information to build a 2-Ddynamic array. For example: "./program 4". This would tell the program that I want to start it and want four players in the program. Specifically, I need help with what parameters would go in there, how I would take those parameters and make a 2-D dynamic array that's number of columns would be the number players entered in the command line and that's rows would equal 16. If you can supply a template of code that achieves those things, I'll mark this question as answered.

NOTE: Please no vectors. Only dynamic arrays, pointers, references, or anything simpler than those things. If you can include helpful comments explaining the logic behind what you're doing, I'd be super appreciative of that too :) Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!