473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

struct and union alignment


I would like to check if I understand the following excerpt correctly:

6.2.5#26 (Types):
All pointers to structure types shall have the same representation and
alignment requirements as each other. All pointers to union types shall
have the same representation and alignment requirements as each other.

Does it mean that *all* structure (or union) types have the same
alignment?
Eg. type
struct { char c; }
and
struct { long double ldt[11]; }
have the same alignment requirements?
If the answer to the above is "yes", then it means that:

1. Alignment of any struct (union) must be maximum or its multiple.
(Alignment of a struct (union) can't be less restrictive than that
of its members[*]. Since any (object) type may be a member, at
least one struct (union) must have at least that type's alignment.
Since all struct (union) types have the same alignment,
it follows that all must meet the the maximum one.)

2. Alignment requirements for all structs _and_ unions are the same.
(Since you can have a struct as a member of a union, and a union as a
member of a struct, it follows that their alignments must be the same).
[*] During google search I have learned that a type's alignments
may differ in a struct and outside. Here I rather mean the least
restrictive alignment requirement for a type that has to be met
for a particular architecture.
--
Stan Tobias
sed 's/[A-Z]//g' to email
Nov 14 '05
67 10602
S.Tobias wrote:

pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:

int *ip;
char *cp;
void *vp;

cp = malloc(2 * sizeof(int));
cp++; //defined
vp = cp; //defined
ip = vp; //???

Assuming that sizeof(int) is greater than one,
ip = vp;
is not defined.


Why?


Because vp holds an address which is not aligned for type int.

--
pete
Nov 14 '05 #51
pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:

pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:
>
> int *ip;
> char *cp;
> void *vp;
>
> cp = malloc(2 * sizeof(int));
> cp++; //defined
> vp = cp; //defined
> ip = vp; //???
Assuming that sizeof(int) is greater than one,
ip = vp;
is not defined.


Why?

Because vp holds an address which is not aligned for type int.


Which point in the Std did you apply to explain this?

--
Stan Tobias
sed 's/[A-Z]//g' to email
Nov 14 '05 #52
S.Tobias wrote:

pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:

pete <pf*****@mindspring.com> wrote:
> S.Tobias wrote:
> >
> > int *ip;
> > char *cp;
> > void *vp;
> >
> > cp = malloc(2 * sizeof(int));
> > cp++; //defined
> > vp = cp; //defined
> > ip = vp; //???

> Assuming that sizeof(int) is greater than one,
> ip = vp;
> is not defined.

Why?

Because vp holds an address which is not aligned for type int.


Which point in the Std did you apply to explain this?


It would be from C89
C89 Last public draft

3.3.4 Cast operators

A pointer to an object or incomplete type may be converted to a
pointer to a different object type or a different incomplete type.
The resulting pointer might not be valid if it is improperly
aligned for the type pointed to.

--
pete
Nov 14 '05 #53
pete wrote:

S.Tobias wrote:

pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:
>
> pete <pf*****@mindspring.com> wrote:
> > S.Tobias wrote:
> > >
> > > int *ip;
> > > char *cp;
> > > void *vp;
> > >
> > > cp = malloc(2 * sizeof(int));
> > > cp++; //defined
> > > vp = cp; //defined
> > > ip = vp; //???
>
> > Assuming that sizeof(int) is greater than one,
> > ip = vp;
> > is not defined.
>
> Why?

Because vp holds an address which is not aligned for type int.


Which point in the Std did you apply to explain this?


It would be from C89
C89 Last public draft

3.3.4 Cast operators

A pointer to an object or incomplete type may be converted to a
pointer to a different object type or a different incomplete type.
The resulting pointer might not be valid if it is improperly
aligned for the type pointed to.


N869
6.3.2.3 Pointers
[#7] A pointer to an object or incomplete type may be
converted to a pointer to a different object or incomplete
type. If the resulting pointer is not correctly aligned
for the pointed-to type, the behavior is undefined.

--
pete
Nov 14 '05 #54
pete <pf*****@mindspring.com> wrote:
pete wrote:

S.Tobias wrote:

pete <pf*****@mindspring.com> wrote:
> S.Tobias wrote:
> >
> > pete <pf*****@mindspring.com> wrote:
> > > S.Tobias wrote:
> > > >
> > > > int *ip;
> > > > char *cp;
> > > > void *vp;
> > > >
> > > > cp = malloc(2 * sizeof(int));
> > > > cp++; //defined
> > > > vp = cp; //defined
> > > > ip = vp; //???
> >
> > > Assuming that sizeof(int) is greater than one,
> > > ip = vp;
> > > is not defined.
> >
> > Why?

> Because vp holds an address which is not aligned for type int.

Which point in the Std did you apply to explain this?
It would be from C89
C89 Last public draft

3.3.4 Cast operators

A pointer to an object or incomplete type may be converted to a
pointer to a different object type or a different incomplete type.
The resulting pointer might not be valid if it is improperly
aligned for the type pointed to.

N869
6.3.2.3 Pointers
[#7] A pointer to an object or incomplete type may be
converted to a pointer to a different object or incomplete
type. If the resulting pointer is not correctly aligned
for the pointed-to type, the behavior is undefined.


Now, why do you think (again, I mean C&V) that a reverse conversion
must _always_ work:
int *ip;
void *vp;
ip = ...; //assume valid pointer
vp = ip;

--
Stan Tobias
sed 's/[A-Z]//g' to email
Nov 14 '05 #55
S.Tobias wrote:

pete <pf*****@mindspring.com> wrote:
pete wrote:

S.Tobias wrote:
>
> pete <pf*****@mindspring.com> wrote:
> > S.Tobias wrote:
> > >
> > > pete <pf*****@mindspring.com> wrote:
> > > > S.Tobias wrote:
> > > > >
> > > > > int *ip;
> > > > > char *cp;
> > > > > void *vp;
> > > > >
> > > > > cp = malloc(2 * sizeof(int));
> > > > > cp++; //defined
> > > > > vp = cp; //defined
> > > > > ip = vp; //???
> > >
> > > > Assuming that sizeof(int) is greater than one,
> > > > ip = vp;
> > > > is not defined.
> > >
> > > Why?
>
> > Because vp holds an address which is not aligned for type int.
>
> Which point in the Std did you apply to explain this?

It would be from C89
C89 Last public draft

3.3.4 Cast operators

A pointer to an object or incomplete type may be converted to a
pointer to a different object type or a different incomplete type.
The resulting pointer might not be valid if it is improperly
aligned for the type pointed to.

N869
6.3.2.3 Pointers
[#7] A pointer to an object or incomplete type may be
converted to a pointer to a different object or incomplete
type. If the resulting pointer is not correctly aligned
for the pointed-to type, the behavior is undefined.


Now, why do you think (again, I mean C&V) that a reverse conversion
must _always_ work:
int *ip;
void *vp;
ip = ...; //assume valid pointer
vp = ip;


Because, according to the requoted standard text,
ip == vp
is guaranteed to be true after that.

(C&V, again)

N869
6.3.2.3 Pointers
[#1] A pointer to void may be converted to or from a pointer
to any incomplete or object type. A pointer to any
incomplete or object type may be converted to a pointer to
void and back again; the result shall compare equal to the
original pointer.

--
pete
Nov 14 '05 #56
pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:

pete <pf*****@mindspring.com> wrote:
pete wrote:
>
> S.Tobias wrote:
> >
> > pete <pf*****@mindspring.com> wrote:
> > > S.Tobias wrote:
> > > >
> > > > pete <pf*****@mindspring.com> wrote:
> > > > > S.Tobias wrote:
> > > > > >
> > > > > > int *ip;
> > > > > > char *cp;
> > > > > > void *vp;
> > > > > >
> > > > > > cp = malloc(2 * sizeof(int));
> > > > > > cp++; //defined
> > > > > > vp = cp; //defined
> > > > > > ip = vp; //???
> > > >
> > > > > Assuming that sizeof(int) is greater than one,
> > > > > ip = vp;
> > > > > is not defined.
> > > >
> > > > Why?
> >
> > > Because vp holds an address which is not aligned for type int.
> >
> > Which point in the Std did you apply to explain this?
>
> It would be from C89
> C89 Last public draft
>
> 3.3.4 Cast operators
>
> A pointer to an object or incomplete type may be converted to a
> pointer to a different object type or a different incomplete type.
> The resulting pointer might not be valid if it is improperly
> aligned for the type pointed to.
N869
6.3.2.3 Pointers
[#7] A pointer to an object or incomplete type may be
converted to a pointer to a different object or incomplete
type. If the resulting pointer is not correctly aligned
for the pointed-to type, the behavior is undefined.


Now, why do you think (again, I mean C&V) that a reverse conversion
must _always_ work:
int *ip;
void *vp;
ip = ...; //assume valid pointer
vp = ip;

Because, according to the requoted standard text,
ip == vp
is guaranteed to be true after that. (C&V, again) N869
6.3.2.3 Pointers
[#1] A pointer to void may be converted to or from a pointer
to any incomplete or object type. A pointer to any
incomplete or object type may be converted to a pointer to
void and back again; the result shall compare equal to the
original pointer.


1. Why do you think that #7 does not apply this time?

2. Why #1 does not apply to void* -> int* conversion?

What are the rules by which you choose which point applies to what
conversion type?

--
Stan Tobias
sed 's/[A-Z]//g' to email
Nov 14 '05 #57
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:
Dan Pop <Da*****@cern.ch> wrote:
struct { ... } foo, bar, baz;

foo, bar and baz are all the objects of this type needed by the program
and they are used in a single translation unit. What would a tag buy you?


I think we're talking of two different things. I used the definition
of an anonymous structure I found in:
http://docs.sun.com/source/816-2460/...xtensions.html


Which, being a C++ compiler extension is certainly topical here, right?

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
Nov 14 '05 #58
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:
pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:
>
> pete <pf*****@mindspring.com> wrote:
> > pete wrote:
> > >
> > > S.Tobias wrote:
> > > >
> > > > pete <pf*****@mindspring.com> wrote:
> > > > > S.Tobias wrote:
> > > > > >
> > > > > > pete <pf*****@mindspring.com> wrote:
> > > > > > > S.Tobias wrote:
> > > > > > > >
> > > > > > > > int *ip;
> > > > > > > > char *cp;
> > > > > > > > void *vp;
> > > > > > > >
> > > > > > > > cp = malloc(2 * sizeof(int));
> > > > > > > > cp++; //defined
> > > > > > > > vp = cp; //defined
> > > > > > > > ip = vp; //???
> > > > > >
> > > > > > > Assuming that sizeof(int) is greater than one,
> > > > > > > ip = vp;
> > > > > > > is not defined.
> > > > > >
> > > > > > Why?
> > > >
> > > > > Because vp holds an address which is not aligned for type int.
> > > >
> > > > Which point in the Std did you apply to explain this?
> > >
> > > It would be from C89
> > > C89 Last public draft
> > >
> > > 3.3.4 Cast operators
> > >
> > > A pointer to an object or incomplete type may be converted to a
> > > pointer to a different object type or a different incomplete type.
> > > The resulting pointer might not be valid if it is improperly
> > > aligned for the type pointed to.
>
> > N869
> > 6.3.2.3 Pointers
> > [#7] A pointer to an object or incomplete type may be
> > converted to a pointer to a different object or incomplete
> > type. If the resulting pointer is not correctly aligned
> > for the pointed-to type, the behavior is undefined.
>
> Now, why do you think (again, I mean C&V) that a reverse conversion
> must _always_ work:
> int *ip;
> void *vp;
> ip = ...; //assume valid pointer
> vp = ip;
Because, according to the requoted standard text,
ip == vp
is guaranteed to be true after that.

(C&V, again)

N869
6.3.2.3 Pointers
[#1] A pointer to void may be converted to or from a pointer
to any incomplete or object type. A pointer to any
incomplete or object type may be converted to a pointer to
void and back again; the result shall compare equal to the
original pointer.


1. Why do you think that #7 does not apply this time?


Because the standard says so: character and void pointer values have
no alignment restrictions. Therefore, when converting something to
pointer to void, the resulting value is, by definition, correctly aligned.
2. Why #1 does not apply to void* -> int* conversion?
It does. But #7 applies too. There is no contradiction between the two.
#1 says that you can do the conversion and #7 says what happens if the
original pointer value was not properly aligned for the type of the result
of the conversion.
What are the rules by which you choose which point applies to what
conversion type?


The rest of the standard. Unfortunately, the standard is very poorly
written as a reference document: you can't only read the paragraph(s)
of immediate interest and expect to get a complete picture of the issue.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
Nov 14 '05 #59
Dan Pop <Da*****@cern.ch> wrote:
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:
Dan Pop <Da*****@cern.ch> wrote:
struct { ... } foo, bar, baz;

foo, bar and baz are all the objects of this type needed by the program
and they are used in a single translation unit. What would a tag buy you?


I think we're talking of two different things. I used the definition
of an anonymous structure I found in:
http://docs.sun.com/source/816-2460/...xtensions.html

Which, being a C++ compiler extension is certainly topical here, right?


I took the first plausible definition I found. C++ is not topical here,
but C++ shares many ideas with C. I thought the definition in above
document was not C++ specific. Anonymous structures aren't topical
here either. I was casually interested, since someone mentioned them.
I think the above example you provided is called "unnamed structure".

--
Stan Tobias
sed 's/[A-Z]//g' to email
Nov 14 '05 #60
pete wrote:
S.Tobias wrote:
pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:

int *ip;
char *cp;
void *vp;

cp = malloc(2 * sizeof(int));
cp++; //defined
vp = cp; //defined
ip = vp; //???

Assuming that sizeof(int) is greater than one,
ip = vp;
is not defined.


Why?


Because vp holds an address which is not aligned for type int.


No. Because the conversion pointertype->void*type->pointertype is
only valid when the two pointertypes are identical.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #61
CBFalconer <cb********@yahoo.com> wrote:
pete wrote:
S.Tobias wrote:
pete <pf*****@mindspring.com> wrote:
S.Tobias wrote:
>
> int *ip;
> char *cp;
> void *vp;
>
> cp = malloc(2 * sizeof(int));
> cp++; //defined
> vp = cp; //defined
> ip = vp; //???

Assuming that sizeof(int) is greater than one,
ip = vp;
is not defined.

Why?
Because vp holds an address which is not aligned for type int.

No. Because the conversion pointertype->void*type->pointertype is
only valid when the two pointertypes are identical.


Would you please explain why? You have drawn two conversions; which
one do you refer to?

--
Stan Tobias
sed 's/[A-Z]//g' to email
Nov 14 '05 #62
Dan Pop <Da*****@cern.ch> wrote:
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:
pete <pf*****@mindspring.com> wrote:
> > N869
> > 6.3.2.3 Pointers
> > [#7] A pointer to an object or incomplete type may be
> > converted to a pointer to a different object or incomplete
> > type. If the resulting pointer is not correctly aligned
> > for the pointed-to type, the behavior is undefined. N869
6.3.2.3 Pointers
[#1] A pointer to void may be converted to or from a pointer
to any incomplete or object type. A pointer to any
incomplete or object type may be converted to a pointer to
void and back again; the result shall compare equal to the
original pointer.
1. Why do you think that #7 does not apply this time? Because the standard says so: character and void pointer values have
And [...] blessed are they that have not seen, and yet have believed!
no alignment restrictions. Therefore, when converting something to
pointer to void, the resulting value is, by definition, correctly aligned.
This is not an answer to my question! I didn't ask about the validity
of conversions nor alignment restrictions!

[ Please don't dismiss my questions with silly answers. I have come
here to learn something, not to turn the world upside-down.
This discussion costs me a lot of effort. I wish I had never started
it, but since I have, I feel obliged to defend my hypothesis as much
as reasonable. It might be proved wrong in the end, but I want to be
convinced by a fair argument. ]
2. Why #1 does not apply to void* -> int* conversion? It does. But #7 applies too.
This is what I claim, too.
There is no contradiction between the two.
#1 says that you can do the conversion and #7 says what happens if the
original pointer value was not properly aligned for the type of the result [ ^^^^^^^^ strictly, it talks about resulting pointer,
but it might be the same as original] of the conversion.
#1 talks about (void*)<->(any*) conversions, #7 talks about
(any*)<->(any*) conversions and adds alignment provisions.
#7 does not exclude *any* pointer type.

If #1 applies to (void*)<->(int*), then #7 applies just as well.

In question 1. I asked pete, why #7 should not apply to (int*)->(void*),
because he seemed to avoid this point in justifying such conversion
(he only cited #1 for this).
I still have not got an answer. I think #7 does apply, too.
What are the rules by which you choose which point applies to what
conversion type?

The rest of the standard.
Would you please be so kind to give some pointers for an example.

Note: in above question I implicitly asked how you choose the rules #1
and #7 exclusively to apply to (void*)<->(int*) conversions, and such an
answer I expect. By no means was it a general question. Since you have
said that both #1 and #7 apply to (void*)->(int*), then the remaining
question is why we can't apply #7 to (int*)->(void*) and where does the
Standard say so; if that's the case of course - else I would like someone
to explicitly say that it applies too.
Unfortunately, the standard is very poorly
written as a reference document: you can't only read the paragraph(s)
of immediate interest and expect to get a complete picture of the issue.


It's true that I have little experience with the Standard, but I'm
learning. I hope you don't expect me to defend my arguments with
K&R2 only, when everybody else is holding the Standard in their hands.
I don't treat it as a reference, I have taken my knowledge from other
books and sources. I have searched (and still do) the whole of Standard
at different places. The discussion has concentrated on very narrow
questions. If you have the knowledge and can point to places in the
Standard to back up one argument or other, please share it with others.

--
Stan Tobias
sed 's/[A-Z]//g' to email
Nov 14 '05 #63
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:
Dan Pop <Da*****@cern.ch> wrote:
The rest of the standard.


Would you please be so kind to give some pointers for an example.


Read the whole standard. If you still need the pointers, I will give
them to you.

If you want to lose your time by reading only random paragraphs, that's
fine, but this is not a reason for wasting my time, too.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
Nov 14 '05 #64
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:
Dan Pop <Da*****@cern.ch> wrote:
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:

>Dan Pop <Da*****@cern.ch> wrote:
>
>> struct { ... } foo, bar, baz;
>
>> foo, bar and baz are all the objects of this type needed by the program
>> and they are used in a single translation unit. What would a tag buy you?
>
>I think we're talking of two different things. I used the definition
>of an anonymous structure I found in:
>http://docs.sun.com/source/816-2460/...xtensions.html

Which, being a C++ compiler extension is certainly topical here, right?


I took the first plausible definition I found. C++ is not topical here,
but C++ shares many ideas with C. I thought the definition in above
document was not C++ specific. Anonymous structures aren't topical
here either. I was casually interested, since someone mentioned them.
I think the above example you provided is called "unnamed structure".


Care to elaborate on the semantical differences between "anonymous" and
"unnamed"?

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
Nov 14 '05 #65
Dan Pop <Da*****@cern.ch> wrote:
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:
Dan Pop <Da*****@cern.ch> wrote:
The rest of the standard.


Would you please be so kind to give some pointers for an example.

Read the whole standard. If you still need the pointers, I will give
them to you.
I don't understand why to answer the simple question: if #7 is applicable
for (int*)->(void*) conversion, I have to read the whole Standard.
It requires only basic intelligence and comprehension.
If you want to lose your time by reading only random paragraphs, that's
"Random" is too much said. I read chapters of most interest to me.
Additionally, I follow the references and search the whole Standard
for things I want to find. I plan to read the Standard from cover
to cover one day, but it'll take some time.

fine, but this is not a reason for wasting my time, too.


I'm not wasting *your* time in *your* newsgroup!

I didn't ask specifically you to answer my posts. You have broken
into the middle of a discussion and deviated it into direction
I didn't want. You have not answered my questions (with exception
perhaps for one issue). I think you're being rude to me this way.
You have been rude at the start of this thread, and I haven't yet
seen your explanation there yet. If you think I'm not worthy
to share in your knowledge and waste your oh so precious time, please
stop reading answering my posts - I won't be sorry about that.

--
Stan Tobias
sed 's/[A-Z]//g' to email
Nov 14 '05 #66
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:
Dan Pop <Da*****@cern.ch> wrote:
In <2r*************@uni-berlin.de> "S.Tobias" <sN*******@amu.edu.pl> writes:

>Dan Pop <Da*****@cern.ch> wrote:
>
>> The rest of the standard.
>
>Would you please be so kind to give some pointers for an example.

Read the whole standard. If you still need the pointers, I will give
them to you.


I don't understand why to answer the simple question: if #7 is applicable
for (int*)->(void*) conversion, I have to read the whole Standard.
It requires only basic intelligence and comprehension.


Then, use them instead of reading the standard and see how far you go.

I gave a *complete* answer to your questions, in a previous post. You
didn't get it either because you're a complete idiot (which doesn't appear
to be the case) or because you're not familiar with the basics of the C
standard. Such familiarity cannot be achieved without reading the
standard.

I could waste some time and spot all the paragraphs you need in order to
understand this issue and spoon feed them to you, but I see no point in
doing it.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
Nov 14 '05 #67
On Fri, 24 Sep 2004 14:02:22 GMT, "xarax" <xa***@email.com> wrote:
"Mabden" <mabden@sbc_global.net> wrote in message
news:mB***************@newssvr14.news.prodigy.com. ..

<snip>
Unions also have the caveat that they be aligned according to the most
restrictive item in the union. So a struct {char a; double z;} could
have a different alignment than union {char a; double z;}.


Wrong. Both the struct and union have the same
alignment as double. A struct's alignment is
the same as the strictest (widest) alignment
of any of its members, including nested aggregates.
Same rules apply for union. The alignment is that
of the strictest alignment of any of its members,
including nested aggregates (other unions or
structs).

That's the common and sensible implementation, but not required. It is
necessary that a struct or union (type) be sufficiently aligned for
each of its members, and never AFAICS necessary to be more, but
nothing prohibits more if an implementor wants it for some reason.

- David.Thompson1 at worldnet.att.net
Nov 14 '05 #68

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Panchal V | last post by:
I want to access a variable length record in C, the format is as follows : +---+---+-----------+ | A | L | D A T A | +---+---+-----------+ A - Some Data (1 BYTE) L - Length the Data that...
0
by: Urs Vogel | last post by:
Hi when setting the struct member alignment of a mixed code project to 'default', what is the actual alignment? I need to know since we're creating (struct-) data dynamically and pass it to a...
4
by: myfavdepo | last post by:
Hi friends, i am having some trouble in my prog. with struct member alignment. I have two different static libraries that i use, each with "struct member alignment" set to 8 bytes. In my...
2
by: cr55 | last post by:
I was wondering if anyone can help me with this programming code as i keep getting errors and am not sure how to fix them. The error code displayed now is error: C2228: left of '.rent' must have...
5
by: xmllmx | last post by:
Please forgive me for cross-posting. I've post this to microsoft.publoc.vc.mfc. But I can't get any response. Maybe only MFC- related topics are cared there. To begin with code: union XXX {...
2
by: yalbizu | last post by:
#include <iostream> #include <string> #include <fstream> #include <iomanip> using namespace std; const int NO_OF_STUDENTS=20; struct studentType { string studentFName; string studentLName;
18
by: Bryan Parkoff | last post by:
I hate using struct / union with dot between two words. How can I use one word instead of two words because I want the source code look reading clear. three variables are shared inside one...
3
by: rajatamilarasu | last post by:
for(i=0 ; i<listNum ; i++) { checker.checkN1DisagreementSwitch(pRep_Active_SList.ChassisID, pRep_Active_SList.SlotID, pRep_Standby_SList.ChassisID, pRep_Standby_SList.SlotID); ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.