I have a data type, say X
, and I want to know its size without declaring a variable or pointer of that type and of course without using sizeof
oper
You could puzzle it out by reading the ABI for your particular processor, which explains how structures are laid out in memory. It's potentially different for each processor. But unless you're writing a compiler it's surprising you don't want to just use sizeof
, which is the One Right Way to solve this problem.