Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program for size of a data type without using
sizeof() operator?

Answer Posted / learner

#include<stdio.h>
void main()
{
char *ptr1,*ptr2;
char fl;//float,double,int
ptr1 = &fl;//it will take the address of f1
ptr2 = (&fl+1);//it wil increment the address with according thr memory size

printf("%u",(char *)ptr2-(char *)ptr1);//explicit type casting for pointers
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a Program to find whether the given number or string is palindrome.

1273


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

2018


Explain the use of keyword 'register' with respect to variables.

1027


How to write c functions that modify head pointer of a linked list?

982


What are the disadvantages of a shell structure?

1342


What is variable declaration and definition in c?

896


explain what are pointers?

1011


What is main function in c?

1075


Why structure is used in c?

1186


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3911


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

1223


What is the best way of making my program efficient?

1029


What does s c mean in text?

1094


Why header file is used in c?

1088


what is recursion in C

1060