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 pointer. What are function pointers in C?

622


Why do we use c for the speed of light?

601


write a program fibonacci series and palindrome program in c

628


How do I use void main?

623


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1424






any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

689


How can I remove the trailing spaces from a string?

606


Can static variables be declared in a header file?

610


How old is c programming language?

569


What is ctrl c called?

586


If fflush wont work, what can I use to flush input?

606


What is difference between union All statement and Union?

628


WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

1853


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

2643


what is stack , heap ,code segment,and data segment

2210