hm.. thanx everyone..
On Fri, Jun 24, 2011 at 2:43 AM, D!leep Gupta wrote:
> #include
> main()
> {
> long double *var;
> printf("%d",(char*)(var+1)-(char*)var);
> return 0;
> }
>
> This also may be the solution... by taking the pointer of that variable...
>
> On Fri, Jun 24, 2011 at 2:09 AM, vaib
#include
main()
{
long double *var;
printf("%d",(char*)(var+1)-(char*)var);
return 0;
}
This also may be the solution... by taking the pointer of that variable...
On Fri, Jun 24, 2011 at 2:09 AM, vaibhav shukla wrote:
> here is the generalized way
>
>
> #include
> #define SIZEOF(var) (size_t)(&v
here is the generalized way
#include
#define SIZEOF(var) (size_t)(&var+1) - (size_t)(&var)
main()
{
double x;
printf("The size of x is %d\n",SIZEOF(x));
return 0;
}
On Fri, Jun 24, 2011 at 1:35 AM, Anika Jain wrote:
> #include
>
> int main()
> {
> char x='9',size=0,count;
> while(x)
>
#include
int main()
{
char x='9',size=0,count;
while(x)
{
x = x<<1;
count++;
if((count=count%8)==0)
{
size++;
}
}
printf("%d\n",size);
return 0;
}
this code i tried to find size of a variable without using sizeof.. but it