Without the prior knowledge that integers store 2 byte in C,or char store 4 byte,float reserves 'so and so bytes',...etc
Is it possible to deduce directly from a C program which datatype store what amount of free memory?
I tried this code but it was without any results.
(As array of any datatype stores consecutive memory locations I declared )
(Then I substracted the adress and printed )Code:int a; char b; float c;
The result should come 4 but it was in vain,it was showing 1 as output which is wrong.....Code:printf("For integer data type : Bytes stored = %d",(&a)-(&a));
In case of deduction of other datatype also ,I went on with the same logic ,but the result in each case was erronious
Refer if some shorter methods available...