Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions