Can U write a C-program to print the size of a data type
without using the sizeof() operator? Explain how it works
inside ?
Answer Posted / saikat
#include <stdio.h>
int main()
{
float a[2];
int size = (char*)&a[1] - (char*)&a[0];
printf("%d
",size);
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what will be maximum number of comparisons when number of elements are given?
What is malloc and calloc?
int i=10; printf("%d %d %d", i, i=20, i);
Does c have enums?
Can a pointer point to null?
Why is it usually a bad idea to use gets()? Suggest a workaround.
What is NULL pointer?
Write a code to generate divisors of an integer?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
What is structure padding in c?
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
Write a program to swap two numbers without using third variable in c?
What is strcmp in c?
Tell me is null always defined as 0(zero)?
How do I read the arrow keys? What about function keys?