C/Visual C - Is Memory Affected in Data Structure?

 
Vista:
Imágen de perfil de Ankit
Val: 2
Ha disminuido su posición en 4 puestos en C/Visual C (en relación al último mes)
Gráfica de C/Visual C

Is Memory Affected in Data Structure?

Publicado por Ankit (1 intervención) el 09/11/2020 09:22:11
Hello Everyone, Can anyone explain me do I know how the memory is affected by signed and unsigned numbers? Actually, I am preparing some topics for the data structure interview and I have doubts regarding this. If anyone knows please suggest me.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Is Memory Affected in Data Structure?

Publicado por Nacho (76 intervenciones) el 09/11/2020 12:47:42
char c = 1 bits 00000001
char c = -1 bits 11111111
short s = 1 bits 0000000000000001
short s = -1 bits 1111111111111111
int i = 1 bits 00000000000000000000000000000001
int i = -1 bits 11111111111111111111111111111111

If the sign bit is 1, then the number is negative.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil
Val: 3
Ha aumentado su posición en 24 puestos en C/Visual C (en relación al último mes)
Gráfica de C/Visual C

Is Memory Affected in Data Structure?

Publicado por Jyoti (1 intervención) el 03/12/2020 14:18:41
Data structures may be padded for data alignment as mentioned in “How to avoid wasting megabytes of memory a few bytes at a time.” Those unused bytes used to align fields in the data structure contribute to the wasted bandwidth every time the data structure is loaded from memory or stored to memory.

To know more visit here.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar