Posts by p.h_compilado • 13 points
3 posts
-
0
votes2
answers77
viewsQ: Memory allocation with malloc()
Doubt 1: The pont should reserve a memory block for 1 integer which was requested on malloc(), but he reserves 32 bytes or a memory block for 8 integers. 'Cause he does it? Doubt 2: If I make one…
-
0
votes2
answers77
viewsQ: nextLine() problem inside the loop
The user must enter different name and password, while they are equal will stay in the loop ... Scanner teclado = new Scanner(System.in); String nome, senha; do{ System.out.println("Digite nome:");…
-
0
votes0
answers19
viewsQ: C-struct occupies more memory space than the sequence of its members
No 1° example a struct occupies 16bytes: #include <Studio.h> int main() { struct horario{ int hora; int minuto; int *h; }; struct horario agora; int tamanho = sizeof(agora); printf("%d…