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 in c programming?
Define Array of pointers.
What is an operator?
Is linux written in c?
Not all reserved words are written in lowercase. TRUE or FALSE?
What are type modifiers in c?
What does do in c?
Can include files be nested? How many levels deep can include files be nested?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
Why is it important to memset a variable, immediately after allocating memory to it ?
What are the advantages of using new operator as compared to the function malloc ()?
Explain how do you list files in a directory?
Is there a way to compare two structure variables?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
Explain what is the purpose of "extern" keyword in a function declaration?