employer cover photo
employer logo
employer logo

Tismo Technology Solutions

Is this your company?

Tismo Technology Solutions interview question

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

Interview Answer

Anonymous

14 Apr 2021

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