1. ## Help getting started..matrices

I need some help getting started multiplying matrices.

This is the pseudocode i am given.

Code:
```int main(int argc, char **argv) {
step 1: check if the command line arguments are passed correctly
step 2: read the first matrix from file and store it in an array
step 3: read the second matrix from file and store it in an array
step 4: check if the two matrices are multiplicable
step 5: multiply the two matrices and store the product in an array
step 6: print out the product in readable format
} /* main() */```
I know you arent supposed to do my hw but can you get me started?

2. There aren't a whole lot of steps (as in, none) between "reading the pseudocode step" and "writing C code that does exactly that". If it's not given in the assignment, you'll have to decide what the command line arguments are supposed to look like. You'll have to know how the numbers are stored in the files (are the dimensions given? etc.) You'll have to know how to multiply matrices, I guess, and you'll probably have to know how to create a two-dimensional matrix on-the-fly (since the dimensions of the result appear not to be specified ahead of time).

3. Writing the c code is where I have trouble.

the command line arguments should look like

program.exe filea.txt fileb.txt

the number are stored in the files in rows and columns separated by spaces, dimensions ARE given in the file.

I have the multiplication of matrices coded, I really just need help with specifying the arguments in C which the user types in.

I can get 2 numbers corresponding to each row and column in 2 matrices to multiply but how do i get the program to read the files the user types then multiply them and store it in an array?

4. 1. So make sure that there are two command-line arguments. That is, argc must equal three (or at least three, if you'll allow them to type extra stuff).

2. Open the file, read in the dimensions, create a two-dimensional array with those dimensions, and then crank out a for loop that reads all the rest of the numbers.

5. OK, can you help me with error outputs for unrecognized arguments. How can i get it so if the user doesn't type the right argument types(.txt file) it will print an error. I have a switch, but what can i put in the case so it will be ony a .txt file will be recognized, as in what goes in the '*txt' part of the case?
Code:
```case '*.txt':
(start function for program)```
do you get what im trying to do?

6. You can verify that the file name has .txt in it. You probably shouldn't, but you can -- just search for .txt in argv[1] and argv[2]; if you find it hooray, if you don't boo.

7. what is the function for searching within an argument?

8. If searching within a string, look at that chapter called "Strings" in your book -- you're probably looking for strstr.