I'm trying to make a pretty specific multiplication table using arrays and a command line argument. I have my program kind of outlined as far as the functions go, but am not sure on a few things. Here is the program:
#include <iostream>
#include <stdlib.h>
usingnamespace std;
struct mult_div_values {
int mult;
float div;
};
int mult_div_values** create_table(int m, int n) //Creates matrix of structs given m and n
void set_mult_values(mult_div_values **table, int m, int n) //Sets multiplications values
{
}
void set_div_values(mult_div_values **table, int m, int n) //Sets division values
{
}
int main(int argc, char* argv[])
{
int rows=atoi(argv[1]); //Converts string inputted into int
int cols=atoi(argv[2]);
return 0;
}
So basically what I want to be able to do is run the program with ./table 6 6 (or whatever two numbers) and it will make a multiplication table and division table that are 6 by 6. It would assign the multiplication table to the mult struct and the division table to the div struct.
So other than getting input as to how my program looks so far, I have a few questions. How do I make it so that I can run the rows/columns in the command line? How do I create the table? And how do I get the multiplication and division values set? Any help is appreciated.
Also, with line eleven of my code, I get an error. It says "expected initializer before â*â token." But that line of code was provided to me, so I'm not sure what to do with it or what it was supposed to mean.