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

C / C++ / MFC

 
AnswerRe: Basic Server/Client TCP/IP Software Examples Pin
Richard MacCutchan6-Jan-19 22:35
mveRichard MacCutchan6-Jan-19 22:35 
QuestionRe initializing an array in C++ ? Pin
Vaclav_26-Dec-18 7:39
MemberVaclav_26-Dec-18 7:39 
QuestionRe: Re initializing an array in C++ ? Pin
David Crow26-Dec-18 7:51
MemberDavid Crow26-Dec-18 7:51 
AnswerRe: Re initializing an array in C++ ? Pin
Vaclav_26-Dec-18 8:20
MemberVaclav_26-Dec-18 8:20 
QuestionRe: Re initializing an array in C++ ? Pin
David Crow26-Dec-18 14:08
MemberDavid Crow26-Dec-18 14:08 
AnswerRe: Re initializing an array in C++ ? Pin
Richard MacCutchan26-Dec-18 22:29
mveRichard MacCutchan26-Dec-18 22:29 
AnswerRe: Re initializing an array in C++ ? Pin
Vaclav_27-Dec-18 6:02
MemberVaclav_27-Dec-18 6:02 
GeneralRe: Re initializing an array in C++ ? Pin
Richard MacCutchan27-Dec-18 6:54
mveRichard MacCutchan27-Dec-18 6:54 
Most of that code is not going to do what you think.
memset(pDataArray, *a, sizeof(a));
You are trying to fill the area pointed to by pDataArray, but you never initialise it to point to anything, so it will likely crash your application. Also you are trying to fill pDataArray with the value stored in the first element of a. Is that what you actually mean?
memset(pDataArray, b[32], sizeof(b));
You are trying to fill pDataArray with the value stored in a random element: b[32] refers to a cell 1 beyond the end of that array.

In both cases why are you using the memset (presumably you actually mean memcpy), since you do not use pDataArray for anything useful?
GeneralRe: Re initializing an array in C++ ? Pin
Victor Nijegorodov27-Dec-18 7:16
MemberVictor Nijegorodov27-Dec-18 7:16 
AnswerRe: Re initializing an array in C++ ? Pin
Vaclav_27-Dec-18 9:09
MemberVaclav_27-Dec-18 9:09 
GeneralRe: Re initializing an array in C++ ? Pin
Richard MacCutchan27-Dec-18 22:16
mveRichard MacCutchan27-Dec-18 22:16 
QuestionC programming Question on Characters Pin
Member 1409794322-Dec-18 7:12
MemberMember 1409794322-Dec-18 7:12 
AnswerRe: C programming Question on Characters Pin
David Crow22-Dec-18 16:46
MemberDavid Crow22-Dec-18 16:46 
GeneralRe: C programming Question on Characters Pin
Member 1409794322-Dec-18 20:32
MemberMember 1409794322-Dec-18 20:32 
GeneralRe: C programming Question on Characters Pin
jschell23-Dec-18 7:44
Memberjschell23-Dec-18 7:44 
GeneralRe: C programming Question on Characters Pin
David Crow23-Dec-18 12:50
MemberDavid Crow23-Dec-18 12:50 
GeneralRe: C programming Question on Characters Pin
David Crow23-Dec-18 12:54
MemberDavid Crow23-Dec-18 12:54 
AnswerRe: C programming Question on Characters Pin
jschell23-Dec-18 7:43
Memberjschell23-Dec-18 7:43 
AnswerRe: Spurious end of file error from ifstream::read Pin
Richard MacCutchan22-Dec-18 4:37
mveRichard MacCutchan22-Dec-18 4:37 
QuestionPostMessage fails with ERROR_NOT_ENOUGH_QUOTA (PROBLEM FOUND, thanks all) Pin
Maximilien19-Dec-18 4:53
MemberMaximilien19-Dec-18 4:53 
QuestionRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
David Crow19-Dec-18 5:13
MemberDavid Crow19-Dec-18 5:13 
AnswerRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Maximilien19-Dec-18 6:45
MemberMaximilien19-Dec-18 6:45 
AnswerRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Richard MacCutchan19-Dec-18 5:15
mveRichard MacCutchan19-Dec-18 5:15 
GeneralRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Maximilien19-Dec-18 6:46
MemberMaximilien19-Dec-18 6:46 
GeneralRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Richard MacCutchan19-Dec-18 21:56
mveRichard MacCutchan19-Dec-18 21:56 

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.