I have the following struct:
typedef struct {
int row;
int** matrix;
} values ;
To fill the struct matrix I tried the following code:
values **v = (values **)malloc(x * sizeof(values *));
for (int z = 0; z < y; ++z)
[z] = (values *)malloc(y * sizeof(values));
Where x is the number of rows and y columns.
How can I populate the arguments (row
and matrix
) of struct and pass as parameter to a function called by pthread?
Something similar to...
pthread_create(&thread1, NULL, somaLinha, v);