Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Differences in struct size in VS .NET 2003
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 26th March 05:27
herb sutter
External User
 
Posts: 1
Default Differences in struct size in VS .NET 2003


Yes, this is a bug that was introduced in VC++ 2003 (aka 7.1). It's
misreading the declaration of STRUCT1::bob -- this becomes obvious from
the type mismatch error message you get when you insert lines that assign
from a STRUCT1::bob to a STRUCT2::bob.

The workaround is to declare fred and bob on separate lines, as in
STRUCT2. This bug has been fixed in the code base for the next version,
but I don't know when the fix will appear in a service pack for the
current version.

Herb

---
Herb Sutter (http://www.gotw.ca)

Convener, ISO WG21 (C++ standards committee) (http://www.gotw.ca/iso)
Contributing editor, C/C++ Users Journal (http://www.gotw.ca/cuj)
Visual C++ program manager, Microsoft (http://www.gotw.ca/microsoft)

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
  Reply With Quote


  sponsored links


2 26th March 05:29
miles dennis
External User
 
Posts: 1
Default Differences in struct size in VS .NET 2003


I appreciate that the thread is concerned with the difference between
the struct interpretations in the various compiler editions, but there
appears to be some additional confusion as to what the struct elements
are supposed to be.

char (*fred)[10] declares fred as a ptr to array of 10 chars
char* (*fred)[10] would declare fred as a ptr to array of 10 ptrs to char
char* fred[10] array of 10 ptrs to char

char.

char,

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
  Reply With Quote
3 31st March 06:31
ste_margetts
External User
 
Posts: 1
Default Differences in struct size in VS .NET 2003


Many thanks for your help. I'm looking forward to the update...

Steve

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666