Most voted "sizeof" questions
None
Learn more…5 questions
Sort by count of
-
3
votes2
answers159
viewsWhy is the value in bytes displayed as 4?
I am using a 2x2 matrix with a simple pointer and want to display the values of it. #include <stdio.h> #include <stdlib.h> typedef struct matriz mat; struct matriz { int lin; int col;…
-
2
votes2
answers1067
views -
2
votes2
answers231
viewssizeof does not work to determine the size of malloc
Well, I was doing a data structure job when I came across the need to dynamically allocate a vector, however, even allocating the space needed for the structure, the value returned by sizeof is…
-
2
votes1
answer39
viewsConfusion in access to vector size in C bytes
In the code below: #include <stdio.h> void testaTamanhoVetor(int vetor[]) { printf("tamanho do vetor em bytes na funcao: %zu", sizeof(vetor)); } int main() { int a[10]; printf("tamanho do…
-
0
votes1
answer48
viewsI have dynamically stored memory of a vector in C, does not return the allocated size, why?
This code is an example of another code with the same problem. I dynamically stored the memory, but when I’m printing the vector size with the len, strangely prints 1 and not 10 as expected. The…