Click here to Skip to main content
15,884,388 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Structure containing byte[1] as member variable Pin
Chris Losinger6-Sep-12 9:19
professionalChris Losinger6-Sep-12 9:19 
GeneralRe: Structure containing byte[1] as member variable Pin
jschell13-Sep-12 8:07
jschell13-Sep-12 8:07 
GeneralRe: Structure containing byte[1] as member variable Pin
Chris Losinger13-Sep-12 8:11
professionalChris Losinger13-Sep-12 8:11 
GeneralRe: Structure containing byte[1] as member variable Pin
jschell14-Sep-12 8:41
jschell14-Sep-12 8:41 
GeneralRe: Structure containing byte[1] as member variable Pin
Stefan_Lang5-Sep-12 1:57
Stefan_Lang5-Sep-12 1:57 
GeneralRe: Structure containing byte[1] as member variable Pin
jschell5-Sep-12 11:26
jschell5-Sep-12 11:26 
GeneralRe: Structure containing byte[1] as member variable Pin
Stefan_Lang6-Sep-12 2:53
Stefan_Lang6-Sep-12 2:53 
GeneralRe: Structure containing byte[1] as member variable Pin
jschell6-Sep-12 8:28
jschell6-Sep-12 8:28 
Stefan_Lang wrote:
From a C++ programmers point of view it's terribad


In general I would agree with that statement.

Stefan_Lang wrote:
However, using such structs breaks expectations...,


I would expect that at experienced C developer would be familar with the idiom and thus would adjust their expectations accordingly.

Stefan_Lang wrote:
This information can only be passed by comments


Myself I would indeed comment it. But in my experience I comment code much more than almost everyone else. I have in fact never worked with anyone that comments code as rigorously as I do.

Stefan_Lang wrote:
not via source code, and the compiler has no way of telling whether you're doing
it right.


Actually the source code, as per many other idioms, is in fact a method of learning how it works. And often the only way for many idioms regardless of how apt they are or not.

And for C there are many things that the compiler can't check.


Stefan_Lang wrote:
Managing pointers and avoiding leaks is easy in comparison, and quite easily
managed by a decent set of guidelines.


Myself I find using the idiom easy. There are far more complicated things in C such as building deep data hierarchies dynamically.


Stefan_Lang wrote:
So you could define a sufficiently large memory block an the stack to store
values within that function.


Your description is not that clear but best I can tell it is not an apt use for this idiom. Incorrect usage does not of course invalidate the idiom itself.
AnswerRe: Structure containing byte[1] as member variable Pin
Richard MacCutchan4-Sep-12 9:07
mveRichard MacCutchan4-Sep-12 9:07 
GeneralRe: Structure containing byte[1] as member variable Pin
Rahul from Poona4-Sep-12 20:00
Rahul from Poona4-Sep-12 20:00 
GeneralRe: Structure containing byte[1] as member variable Pin
Richard MacCutchan4-Sep-12 21:46
mveRichard MacCutchan4-Sep-12 21:46 
AnswerRe: Structure containing byte[1] as member variable Pin
jschell4-Sep-12 11:46
jschell4-Sep-12 11:46 
QuestionFinding crash information using the MAP file in vs2005 Pin
neha_soni4-Sep-12 1:10
neha_soni4-Sep-12 1:10 
AnswerRe: Finding crash information using the MAP file in vs2005 Pin
David Crow4-Sep-12 2:35
David Crow4-Sep-12 2:35 
AnswerRe: Finding crash information using the MAP file in vs2005 Pin
krmed4-Sep-12 3:33
krmed4-Sep-12 3:33 
AnswerRe: Finding crash information using the MAP file in vs2005 Pin
Stephen Hewitt6-Sep-12 21:46
Stephen Hewitt6-Sep-12 21:46 
Question(SOLVED) make single executable file in vs2008 (MFC) Pin
jawadali4773-Sep-12 1:26
jawadali4773-Sep-12 1:26 
AnswerRe: make single executable file in vs2008 (MFC) Pin
pasztorpisti3-Sep-12 2:05
pasztorpisti3-Sep-12 2:05 
GeneralRe: make single executable file in vs2008 (MFC) Pin
jawadali4774-Sep-12 17:42
jawadali4774-Sep-12 17:42 
GeneralRe: make single executable file in vs2008 (MFC) Pin
pasztorpisti4-Sep-12 23:04
pasztorpisti4-Sep-12 23:04 
GeneralRe: make single executable file in vs2008 (MFC) Pin
jawadali4779-Sep-12 17:45
jawadali4779-Sep-12 17:45 
GeneralRe: make single executable file in vs2008 (MFC) Pin
pasztorpisti9-Sep-12 21:26
pasztorpisti9-Sep-12 21:26 
GeneralRe: make single executable file in vs2008 (MFC) Pin
jawadali47710-Sep-12 17:17
jawadali47710-Sep-12 17:17 
AnswerRe: make single executable file in vs2008 (MFC) Pin
Stephen Hewitt3-Sep-12 16:51
Stephen Hewitt3-Sep-12 16:51 
AnswerRe: make single executable file in vs2008 (MFC) Pin
Richard MacCutchan3-Sep-12 22:22
mveRichard MacCutchan3-Sep-12 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.