let's take a code
struct FAQ
{
int a;
char b;
float c;
double d;
int a[10];
}*temp;
now explain me how the memory will be allocated for the
structure FAQ and what address will be in the structure
pointer (temp)....................
Answer Posted / vrushali
Memory allocated will be word aligned in nature.
e.g. for int the address would be allocated as a multiple of
4 .... Next char would start the n+1 where n = multiple of 4.
Similarly next....
when we do sizeof structure we get 60 bytes...
But originally , it should be
4 + 1+ 4+ 8 + 4 *10 = 57 bytes.
The extra three bytes are from char where 3 bytes are wasted
in memory space.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
How do you write a program which produces its own source code as output?
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
When would you use a pointer to a function?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
Which is an example of a structural homology?
Do array subscripts always start with zero?
Simplify the program segment if X = B then C ← true else C ← false
What is merge sort in c?
What are qualifiers and modifiers c?
What does c mean?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
What is sorting in c plus plus?
What is a function in c?
Explain bitwise shift operators?