Click here to Skip to main content

C / C++ / MFC

 
GeneralRe: Structure containing byte[1] as member variable PinmemberStefan_Lang5-Sep-12 2:57 
GeneralRe: Structure containing byte[1] as member variable Pinmemberjschell5-Sep-12 12:26 
GeneralRe: Structure containing byte[1] as member variable PinmemberStefan_Lang6-Sep-12 3:53 
GeneralRe: Structure containing byte[1] as member variable Pinmemberjschell6-Sep-12 9:28 
AnswerRe: Structure containing byte[1] as member variable PinmvpRichard MacCutchan4-Sep-12 10:07 
GeneralRe: Structure containing byte[1] as member variable PinmemberRahul from Poona4-Sep-12 21:00 
GeneralRe: Structure containing byte[1] as member variable PinmvpRichard MacCutchan4-Sep-12 22:46 
AnswerRe: Structure containing byte[1] as member variable Pinmemberjschell4-Sep-12 12:46 
Rahul from Poona wrote:
I m reading some data from device whose length I dont know at compile so I made
a structure as of following type to store data

 
What are you trying to do?
 
There is a common C idiom which might be applicable for what you are doing and which your structure would support - if you use it correctly.
 
It however isn't necessarily the best way to do that in all situations.
And as mentioned if you are not very CAREFUL then you can introduce some or all of the following problems.
- Memory leaks
- Crashes caused in any number of ways by pointer bugs.
 
The standard C idiom for this is found in the following link.
 
http://c-faq.com/struct/structhack.html[^]
 
Keep in mind that you must clean this up in the same way that you allocate it.
QuestionFinding crash information using the MAP file in vs2005 Pinmemberneha_soni4-Sep-12 2:10 
AnswerRe: Finding crash information using the MAP file in vs2005 PinmemberDavidCrow4-Sep-12 3:35 
AnswerRe: Finding crash information using the MAP file in vs2005 Pinmemberkrmed4-Sep-12 4:33 
AnswerRe: Finding crash information using the MAP file in vs2005 PinmemberStephen Hewitt6-Sep-12 22:46 
Question(SOLVED) make single executable file in vs2008 (MFC) [modified] Pinmemberjawadali4773-Sep-12 2:26 
AnswerRe: make single executable file in vs2008 (MFC) [modified] Pinmemberpasztorpisti3-Sep-12 3:05 
GeneralRe: make single executable file in vs2008 (MFC) [modified] Pinmemberjawadali4774-Sep-12 18:42 
GeneralRe: make single executable file in vs2008 (MFC) Pinmemberpasztorpisti5-Sep-12 0:04 
GeneralRe: make single executable file in vs2008 (MFC) Pinmemberjawadali4779-Sep-12 18:45 
GeneralRe: make single executable file in vs2008 (MFC) Pinmemberpasztorpisti9-Sep-12 22:26 
GeneralRe: make single executable file in vs2008 (MFC) Pinmemberjawadali47710-Sep-12 18:17 
AnswerRe: make single executable file in vs2008 (MFC) PinmemberStephen Hewitt3-Sep-12 17:51 
AnswerRe: make single executable file in vs2008 (MFC) PinmvpRichard MacCutchan3-Sep-12 23:22 
GeneralRe: make single executable file in vs2008 (MFC) Pinmemberpasztorpisti4-Sep-12 2:29 
GeneralRe: make single executable file in vs2008 (MFC) PinmvpRichard MacCutchan4-Sep-12 6:42 
AnswerRe: (SOLVED) make single executable file in vs2008 (MFC) PinmemberMember 103867337-Nov-13 6:00 
QuestionFile download from network drive Pinmembersunilkpv2-Sep-12 23:22 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.150129.1 | Last Updated 1 Feb 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid