B
bharath539
how much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
and how?
struct bharath
{
int b;
char c;
float d;
}
and how?
Enough to fit at least the total memory requirements of the struct.how much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
and how?
how much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
let the int size is 4B then the allocation will be?(e-mail address removed) said:
None. It's a type, not an object.
how much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
and how?
This is exactly the sort of thing that people talk about when they saylet the int size is 4B then the allocation will be?
i want to know the info regarding padding or some other else related
to padding?
[Please use a newsreader that understands how to trim sigs, or trim them
yourself. I've done this for you here.]
let the int size is 4B then the allocation will be?
i want to know the info regarding padding or some other else related
to padding?
This is exactly the sort of thing that people talk about when they say
something is implementation specific. That is, once you actually
allocate for a type, the specifics of how that memory is allocated is
not necessarily dictated by the Standard.
Simply defining (or is it declaring?) the type, of course, allocates no
memory.
--
clvrmnky <mailto:[email protected]>
Direct replies will be blacklisted. Replace "spamtrap" with my name to
contact me directly.
[Please use a newsreader that understands how to trim sigs, or trim them
yourself. I've done this for you here.]let the int size is 4B then the allocation will be?
i want to know the info regarding padding or some other else related
to padding?This is exactly the sort of thing that people talk about when they say
something is implementation specific. That is, once you actually
allocate for a type, the specifics of how that memory is allocated is
not necessarily dictated by the Standard.Simply defining (or is it declaring?) the type, of course, allocates no
memory.Direct replies will be blacklisted. Replace "spamtrap" with my name to
contact me directly.
what i want actually is how much size will be allocated for above
structuer in a 16 bit machine
What we can tell you is that there may be padding characters inserted
between each element of the structure to maintain data item alignment.
If, *for instance*, ints were 4 bytes wide, and floats were 8 bytes
wide, and both were required to be aligned on "even" boundaries (ints
to &int%4==0 boundaries, floats to &float%8==0 boundaries), then the
compiler would likely insert zero padding bytes between your int and
your char, and seven padding bytes
[...][...]
*sigh*
This is exactly the sort of thing that people talk about when they say
something is implementation specific. That is, once you actually
allocate for a type, the specifics of how that memory is allocated is
not necessarily dictated by the Standard.
Simply defining (or is it declaring?) the type, of course, allocates no
memory.
Enough to hold the structure, plus any padding, on this specific 16-bitwhat i want actually is how much size will be allocated for above
structuer in a 16 bit machine
[email protected] said:how much memory is allocated for following structure
struct bharath {
int b;
char c;
float d;
}
and how?
what i want actually is how much size will be allocated for above
structuer in a 16 bit machine
how much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
^^ ';' neededhow much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
With whatever mechanism your compiler allocates space for other variables.and how?
how much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
and how?
It doesn't even have to be the same on all 16-bit machines, or evenbalu said:(e-mail address removed) said:how much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
None. It's a type, not an object.
[Please use a newsreader that understands how to trim sigs, or trim them
yourself. I've done this for you here.]
let the int size is 4B then the allocation will be?
i want to know the info regarding padding or some other else related
to padding?
This is exactly the sort of thing that people talk about when they say
something is implementation specific. That is, once you actually
allocate for a type, the specifics of how that memory is allocated is
not necessarily dictated by the Standard.
Simply defining (or is it declaring?) the type, of course, allocates no
memory.
--
clvrmnky <mailto:[email protected]>
Direct replies will be blacklisted. Replace "spamtrap" with my name to
contact me directly.
what i want actually is how much size will be allocated for above
structuer in a 16 bit machine
(e-mail address removed) wrote:
Enough to hold the structure, plus any padding, on this specific 16-bit
machine.
[email protected] said:how much memory is allocated for following structure
struct bharath
{
int b;
char c;
float d;
}
and how?
(fx:snipping)
what i want actually is how much size will be allocated for above
structuer in a 16 bit machine
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.