write a program for size of a data type without using
sizeof() operator?
Answer Posted / mukesh kumar singh
#include <iostream>
using namespace std;
struct node {
int x;
int y;
char *s;
};
int main()
{
node x,*p;/* here u can change the type */
p=&x;
cout<<"\n\nSize of node Is : "<<(char*)(p+1)-(char*)p;
return 0;
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
Explain main function in c?
What is the use of function in c?
What is zero based addressing?
Why is c called c?
Why c language?
Explain what are the __date__ and __time__ preprocessor commands?
Explain heap and queue.
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
When should the volatile modifier be used?
What is the default value of local and global variables in c?
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
Are global variables static in c?
Explain why can’t constant values be used to define an array’s initial size?
Why is c called a mid-level programming language?