Questions tagged [multi-dimensional-arrays]

3 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

What is the explaination of the declaration of image array in filter

I was looking through the filter.c file in the pset4-filter-less and I want to understand the theory behind the declaration of array as shown below: RGBTRIPLE(*image)[width] = calloc(height, width * ...
0
votes
1answer
261 views

pset3 Tideman: function to print out preferences array is not working

I have written a function, print2d(), to print out a 2D array. I am using it to print out the preferences array after calling record_preferences() in main according to the provided template. The ...
0
votes
1answer
42 views

2D array of given size

I want to create a 2D array of ints, where the array's dimension is given at run time (not compile time). So far, I have been using: int **ptr = malloc(m * sizeof(int*)); for (size_t i = 0; i < m;...