Click here to Skip to main content
12,623,511 members (29,847 online)

C / C++ / MFC

 
GeneralRe: Structure containing byte[1] as member variable Pin
Stefan_Lang5-Sep-12 2:57
memberStefan_Lang5-Sep-12 2:57 
GeneralRe: Structure containing byte[1] as member variable Pin
jschell5-Sep-12 12:26
memberjschell5-Sep-12 12:26 
GeneralRe: Structure containing byte[1] as member variable Pin
Stefan_Lang6-Sep-12 3:53
memberStefan_Lang6-Sep-12 3:53 
GeneralRe: Structure containing byte[1] as member variable Pin
jschell6-Sep-12 9:28
memberjschell6-Sep-12 9:28 
AnswerRe: Structure containing byte[1] as member variable Pin
Richard MacCutchan4-Sep-12 10:07
mvpRichard MacCutchan4-Sep-12 10:07 
GeneralRe: Structure containing byte[1] as member variable Pin
Rahul from Poona4-Sep-12 21:00
memberRahul from Poona4-Sep-12 21:00 
GeneralRe: Structure containing byte[1] as member variable Pin
Richard MacCutchan4-Sep-12 22:46
mvpRichard MacCutchan4-Sep-12 22:46 
AnswerRe: Structure containing byte[1] as member variable Pin
jschell4-Sep-12 12:46
memberjschell4-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 Pin
neha_soni4-Sep-12 2:10
memberneha_soni4-Sep-12 2:10 
AnswerRe: Finding crash information using the MAP file in vs2005 Pin
DavidCrow4-Sep-12 3:35
memberDavidCrow4-Sep-12 3:35 
AnswerRe: Finding crash information using the MAP file in vs2005 Pin
krmed4-Sep-12 4:33
memberkrmed4-Sep-12 4:33 
AnswerRe: Finding crash information using the MAP file in vs2005 Pin
Stephen Hewitt6-Sep-12 22:46
memberStephen Hewitt6-Sep-12 22:46 
Question(SOLVED) make single executable file in vs2008 (MFC) Pin
jawadali4773-Sep-12 2:26
memberjawadali4773-Sep-12 2:26 
AnswerRe: make single executable file in vs2008 (MFC) Pin
pasztorpisti3-Sep-12 3:05
memberpasztorpisti3-Sep-12 3:05 
GeneralRe: make single executable file in vs2008 (MFC) Pin
jawadali4774-Sep-12 18:42
memberjawadali4774-Sep-12 18:42 
GeneralRe: make single executable file in vs2008 (MFC) Pin
pasztorpisti5-Sep-12 0:04
memberpasztorpisti5-Sep-12 0:04 
GeneralRe: make single executable file in vs2008 (MFC) Pin
jawadali4779-Sep-12 18:45
memberjawadali4779-Sep-12 18:45 
GeneralRe: make single executable file in vs2008 (MFC) Pin
pasztorpisti9-Sep-12 22:26
memberpasztorpisti9-Sep-12 22:26 
GeneralRe: make single executable file in vs2008 (MFC) Pin
jawadali47710-Sep-12 18:17
memberjawadali47710-Sep-12 18:17 
AnswerRe: make single executable file in vs2008 (MFC) Pin
Stephen Hewitt3-Sep-12 17:51
memberStephen Hewitt3-Sep-12 17:51 
AnswerRe: make single executable file in vs2008 (MFC) Pin
Richard MacCutchan3-Sep-12 23:22
mvpRichard MacCutchan3-Sep-12 23:22 
GeneralRe: make single executable file in vs2008 (MFC) Pin
pasztorpisti4-Sep-12 2:29
memberpasztorpisti4-Sep-12 2:29 
GeneralRe: make single executable file in vs2008 (MFC) Pin
Richard MacCutchan4-Sep-12 6:42
mvpRichard MacCutchan4-Sep-12 6:42 
AnswerRe: (SOLVED) make single executable file in vs2008 (MFC) Pin
Member 103867337-Nov-13 6:00
memberMember 103867337-Nov-13 6:00 
QuestionFile download from network drive Pin
sunilkpv2-Sep-12 23:22
membersunilkpv2-Sep-12 23: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.


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 2 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid