Posts by sabonet • 15 points
3 posts
-
0
votes1
answer43
viewsQ: How to dynamically allocate memory to a 2D array that stores the pixels of a bmp file in C?
I am trying to dynamically allocate a 2D array to store a bmp file with the following code: #include <stdio.h> #include <stdlib.h> int height, width; // variables for the image height…
-
1
votes1
answer245
viewsQ: Problem with fgets in C
This is the excerpt of my code with the problem: int main (void) { int n_sentencas, n_perguntas; scanf("%d %d", &n_sentencas, &n_perguntas); fflush(stdin); char** sentenca; // ponteiro para…
-
0
votes1
answer152
viewsQ: Helps in C dynamic allocation exercise
The exercise is as follows: Brazil has just bought a new territory where the newest Brazilian state will be built. Unlike the other states, it will have all its infrastructure planned and, for this,…