Hi, I need some help with two dimensional arrays. I need to write a function that will find the element in data, like user enters name and number of colon and it should output the element in that position. Here is the code I have but I'm stuck with 2D array function.
I presume that row k of the matrix (sc[k]) corresponds to the element k in the names (element[k]) and that names have 'num' elements and matrix has 'num' rows.
You seem to be interested in row k of the matrix, so you should find the position of the name that equals to 'skated'.
Obviously, that has nothing to do with the 'sc'. You are looking from the 'element' only.
You don't want to go through all MAX elements, because only 'num' are real. If 'skated' equals element[i], then return i.
If none of the num elements matches, returns something that will reveal the caller that 'skated' was not found.
You should test the 'goe' too; that it is in valid range.