#include<stdio.h>

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 its
only for ints and chars... not general.. does anybody hava a general
answer??

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to