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
Explain the use of 'auto' keyword
Explain what is the benefit of using #define to declare a constant?
What is the purpose of 'register' keyword in c language?
Is struct oop?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is 2 d array in c?
What is clrscr ()?
Is c pass by value or reference?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
What is the significance of scope resolution operator?
Write the control statements in C language
What are the functions to open and close file in c language?
provide an example of the Group by clause, when would you use this clause
What are different types of operators?
Explain what math functions are available for integers? For floating point?