I declare a matrix of integer using malloc():
int *m;
m = malloc(10 * sizeof(int));
Can I use array notation [] to select an element from matrix?
For example:
I use *(m+1)
to select the second element of matrix m.
Can I select the second element of matrix m through this notation: m[1]
?
Yes this is possible. However, if you are specifying it as a static size, you may as well do
int m[10]
in your declaration.