Click here to Skip to main content
14,693,856 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: error C2143: syntax error Pin
Daniel Pfeffer8-Aug-19 2:00
professionalDaniel Pfeffer8-Aug-19 2:00 
AnswerRe: error C2143: syntax error Pin
Stefan_Lang8-Aug-19 22:59
mveStefan_Lang8-Aug-19 22:59 
GeneralRe: error C2143: syntax error Pin
_Flaviu9-Aug-19 1:20
Member_Flaviu9-Aug-19 1:20 
Questionzero-sized array in struct/union Pin
_Flaviu5-Aug-19 22:39
Member_Flaviu5-Aug-19 22:39 
AnswerRe: zero-sized array in struct/union Pin
Victor Nijegorodov5-Aug-19 23:13
MemberVictor Nijegorodov5-Aug-19 23:13 
GeneralRe: zero-sized array in struct/union Pin
_Flaviu5-Aug-19 23:24
Member_Flaviu5-Aug-19 23:24 
GeneralRe: zero-sized array in struct/union Pin
Victor Nijegorodov5-Aug-19 23:28
MemberVictor Nijegorodov5-Aug-19 23:28 
GeneralRe: zero-sized array in struct/union Pin
Randor 5-Aug-19 23:31
professional Randor 5-Aug-19 23:31 
_Flaviu wrote:
Or
char* file_name[1];

Yes.

The only reason someone would declare zero-length is to dynamic allocate the array. You should change the array length to [1]. If you change it to _MAX_PATH (260) then you will be wasting 1036 bytes on a 32 bit machine and wasting 2072 bytes on a 64 bit machine.

Wasting bytes is punishable by death.

Best Wishes,
-David Delaune

modified 6-Aug-19 5:37am.

GeneralRe: zero-sized array in struct/union Pin
CPallini5-Aug-19 23:36
mveCPallini5-Aug-19 23:36 
JokeRe: zero-sized array in struct/union Pin
Randor 5-Aug-19 23:43
professional Randor 5-Aug-19 23:43 
GeneralRe: zero-sized array in struct/union Pin
CPallini6-Aug-19 0:02
mveCPallini6-Aug-19 0:02 
GeneralRe: zero-sized array in struct/union Pin
Randor 6-Aug-19 0:34
professional Randor 6-Aug-19 0:34 
GeneralRe: zero-sized array in struct/union Pin
_Flaviu5-Aug-19 23:40
Member_Flaviu5-Aug-19 23:40 
QuestionRe: zero-sized array in struct/union Pin
CPallini6-Aug-19 0:29
mveCPallini6-Aug-19 0:29 
AnswerRe: zero-sized array in struct/union Pin
Randor 6-Aug-19 0:38
professional Randor 6-Aug-19 0:38 
AnswerRe: zero-sized array in struct/union Pin
leon de boer6-Aug-19 4:23
Memberleon de boer6-Aug-19 4:23 
PraiseRe: zero-sized array in struct/union Pin
CPallini6-Aug-19 11:15
mveCPallini6-Aug-19 11:15 
QuestionRe: zero-sized array in struct/union Pin
Richard MacCutchan5-Aug-19 23:14
mveRichard MacCutchan5-Aug-19 23:14 
AnswerRe: zero-sized array in struct/union Pin
_Flaviu5-Aug-19 23:27
Member_Flaviu5-Aug-19 23:27 
GeneralRe: zero-sized array in struct/union Pin
Richard MacCutchan5-Aug-19 23:43
mveRichard MacCutchan5-Aug-19 23:43 
GeneralRe: zero-sized array in struct/union Pin
Stefan_Lang6-Aug-19 22:53
mveStefan_Lang6-Aug-19 22:53 
GeneralRe: zero-sized array in struct/union Pin
Richard MacCutchan7-Aug-19 2:27
mveRichard MacCutchan7-Aug-19 2:27 
GeneralGet rid of the [] Pin
Davie212406-Aug-19 11:19
MemberDavie212406-Aug-19 11:19 
AnswerRe: zero-sized array in struct/union Pin
CPallini5-Aug-19 23:32
mveCPallini5-Aug-19 23:32 
GeneralRe: zero-sized array in struct/union Pin
_Flaviu5-Aug-19 23:41
Member_Flaviu5-Aug-19 23:41 

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.