Getting the sizeof DATA TYPES without using "sizeof" operator
Hi Folks,
Is there any way out to know the sizeof any DataTYPE without using "sizeof" operator.
My requirement is very simple.
Code:
#include <stdio.h>
int ReturnSize( // the Data Type argument to be passed, may be CHAR, INT, FLOAT, DOUBLE or even STRUCTURE)
{
// Calculates the sizeof the argument WITHOUT using "SIZEOF" operator and returns the size
}
int main()
{
int size;
size = ReturnSize( // Can be CHAR/INT/FLOAT/DOUBLE/STRUCTURE);
}