write a program for size of a data type without using
sizeof() operator?
Answer Posted / subham singh
1 #include<iostream>
2 using namespace std;
3 main()
4 {
5 int i;
6 int* p = &i;
7 int* q= p;
8 p++;
9 cout<<(char*)p-(char*)q<<endl;
10 }
11
~
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why do we use int main instead of void main in c?
What is the easiest sorting method to use?
For what purpose null pointer used?
What is the difference between abs() and fabs() functions?
program to convert a integer to string in c language'
What are header files and what are its uses in C programming?
If I have a char * variable pointing to the name of a function ..
Write a code on reverse string and its complexity.
Why is extern used in c?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
What are the 5 types of inheritance in c ++?
Why is c called a mid-level programming language?
Is exit(status) truly equivalent to returning the same status from main?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
why programs in c are running with out #include