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


Please Help Members By Posting Answers For Below Questions

Explain spaghetti programming?

992


Explain about block scope in c?

885


What is build process in c?

902


Can we change the value of #define in c?

805


What is time complexity c?

782


When should I declare a function?

843


What are the __date__ and __time__ preprocessor commands?

817


What does s c mean on snapchat?

825


cavium networks written test pattern ..

3845


What is the c value paradox and how is it explained?

830


What is a pointer on a pointer in c programming language?

883


What is a const pointer?

837


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

2142


What is context in c?

759


What is wrong with this code?

956