Pregunta de entrevista de Tismo Technology Solutions

Write a function to find size of variable without using the library function sizeof()

Respuesta de la entrevista

Anónimo

14 abr 2021

Use pointer arithmatic int a = 3 ; char* p1, *p2 ; p1 = (char*)&a ; p2 = (char*)((&a) + 1) ; size = p2 - p1