Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: virtual destructor Pin
David Crow18-Oct-07 4:26
David Crow18-Oct-07 4:26 
GeneralOff Topic, Don't rate this ! Pin
toxcct18-Oct-07 4:27
toxcct18-Oct-07 4:27 
GeneralRe: virtual destructor Pin
Nemanja Trifunovic18-Oct-07 5:42
Nemanja Trifunovic18-Oct-07 5:42 
GeneralRe: virtual destructor Pin
George_George18-Oct-07 19:19
George_George18-Oct-07 19:19 
QuestionHow to make setup Borland C++ Builder 6 Pin
upamir18-Oct-07 1:42
upamir18-Oct-07 1:42 
AnswerRe: How to make setup Borland C++ Builder 6 Pin
Nelek18-Oct-07 2:41
protectorNelek18-Oct-07 2:41 
GeneralRe: How to make setup Borland C++ Builder 6 Pin
upamir20-Oct-07 23:21
upamir20-Oct-07 23:21 
QuestionIs there an alternative solution to this? [Solved] Pin
Nelek18-Oct-07 0:51
protectorNelek18-Oct-07 0:51 
Hi all,

the other day someone asked about intializing a buffer (this post)[^]).

Today I have had more or less the same problem, but with a pointer. The case is:

I have a fixed area of data available to write data in a PLC, but the data itself can be variable (Area = 4096 Bytes, data = [64 ~ 4096]). The length depends on the actual project opened in the application. As the data in the PLC are permanent and a project may be shorter than another, I want to ensure empty values in the rest of the destiny that are over the length of the actual project. (I hope you can understand what I mean).


With a normal buffer like in the post of the other day is:
BYTE Buffer [BUF_LENGTH] = {0};


but a pointer created with new is fulled of "I" = 240 = 0xCD. As I want to have "0", I am now using:
nBufLength = nTotalArea - nValidWrittenData;
BYTE* pBuffer = NULL;
pBuffer = new BYTE [nBufLength];
for (int i = 0; i < nBufLength; i++)
	*(pBuffer + i) = 0;


Which other possibilities can I use / do you recommend to write "0" in the whole buffer?


-- modified at 7:18 Thursday 18th October, 2007

Greetings.

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

Help me to understand what I'm saying, and I'll explain it better to you

Wink | ;)

AnswerRe: Is there an alternative solution to this? Pin
Chris Losinger18-Oct-07 0:56
professionalChris Losinger18-Oct-07 0:56 
GeneralRe: Is there an alternative solution to this? [SOLVED] Pin
Nelek18-Oct-07 1:07
protectorNelek18-Oct-07 1:07 
GeneralRe: Is there an alternative solution to this? Pin
sps-itsec4618-Oct-07 1:25
sps-itsec4618-Oct-07 1:25 
GeneralRe: Is there an alternative solution to this? Pin
James R. Twine18-Oct-07 1:38
James R. Twine18-Oct-07 1:38 
GeneralRe: Is there an alternative solution to this? Pin
sps-itsec4618-Oct-07 5:27
sps-itsec4618-Oct-07 5:27 
GeneralRe: Is there an alternative solution to this? Pin
James R. Twine18-Oct-07 12:09
James R. Twine18-Oct-07 12:09 
GeneralRe: Is there an alternative solution to this? Pin
sps-itsec4625-Oct-07 12:55
sps-itsec4625-Oct-07 12:55 
GeneralRe: Is there an alternative solution to this? Pin
James R. Twine25-Oct-07 13:52
James R. Twine25-Oct-07 13:52 
GeneralRe: Is there an alternative solution to this? Pin
sps-itsec4626-Oct-07 6:41
sps-itsec4626-Oct-07 6:41 
AnswerRe: Is there an alternative solution to this? [Solved] Pin
James R. Twine18-Oct-07 1:44
James R. Twine18-Oct-07 1:44 
GeneralRe: Is there an alternative solution to this? [Solved] [modified] Pin
Nelek18-Oct-07 2:21
protectorNelek18-Oct-07 2:21 
QuestionWireless network Adapter Interface GUID... WM_DEVICECHANGE Pin
Ravinder Are18-Oct-07 0:47
Ravinder Are18-Oct-07 0:47 
Questionsocket programming Pin
laggraw18-Oct-07 0:45
laggraw18-Oct-07 0:45 
AnswerRe: socket programming Pin
Parthi_Appu18-Oct-07 0:55
Parthi_Appu18-Oct-07 0:55 
GeneralRe: socket programming Pin
laggraw23-Oct-07 23:00
laggraw23-Oct-07 23:00 
AnswerRe: socket programming Pin
Cedric Moonen18-Oct-07 1:40
Cedric Moonen18-Oct-07 1:40 
GeneralRe: socket programming Pin
laggraw23-Oct-07 22:50
laggraw23-Oct-07 22:50 

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.