Click here to Skip to main content
15,905,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Need help in using CryptoAPI Pin
karl_w6-Feb-03 19:48
karl_w6-Feb-03 19:48 
GeneralCTreeCtrl selects item by itself!!! Pin
Mr.Freeze6-Feb-03 15:19
Mr.Freeze6-Feb-03 15:19 
GeneralEasy question: Pin
Sunnygirl6-Feb-03 13:35
Sunnygirl6-Feb-03 13:35 
GeneralRe: Easy question: Pin
Chris Losinger6-Feb-03 14:09
professionalChris Losinger6-Feb-03 14:09 
GeneralRe: Easy question: Pin
georgiek506-Feb-03 14:18
georgiek506-Feb-03 14:18 
GeneralRe: Easy question: Pin
Harold Bamford7-Feb-03 5:49
Harold Bamford7-Feb-03 5:49 
GeneralRe: Easy question: Pin
georgiek507-Feb-03 6:00
georgiek507-Feb-03 6:00 
GeneralRe: Easy question: Pin
Harold Bamford7-Feb-03 6:18
Harold Bamford7-Feb-03 6:18 
georgiek50 wrote:
Even though it is an array of byte wouldn't \0 take care of everything? which brings me to ask another question. If I declared an array of bytes say array[100] but then only needed to fill the first fifty. Do I need a NULL character like in a string? If yes how would I set it. If no, why not?

I didn't make myself clear. If you are using the array of bytes as a null-terminated cstring:

strcpy(r1,"This is a string");

Then terminating at the "zero'th" position will clear out the string. For example, if you said:

strcpy(r1,"0123456789 This is a string");
r1[15] = 0;
printf("%s\n", r1);

The output would be "0123456789 This"

If you then dumped the first 20 bytes of r1:

for(int i = 0; i < 20; i++)
{
   printf("0x%02X ", r1[i]);
}

You would get something like:

0x30 0x31 0x32 ... 0x39 0x20 0x54 0x68 0x69 0x73 0x00 0x69 0x73 ...

That's the convention for null-terminated cstrings (not to be confused with CString); a 0 terminates the string. If it is just an array of bytes, then 0 is just another value.
GeneralRe: Easy question: Pin
georgiek507-Feb-03 7:38
georgiek507-Feb-03 7:38 
Generalbitmaps in statusbar Pin
Crash Operator6-Feb-03 13:20
Crash Operator6-Feb-03 13:20 
GeneralRe: bitmaps in statusbar Pin
-Dy6-Feb-03 23:04
-Dy6-Feb-03 23:04 
GeneralNot to Get Black background image Pin
mkashifkkj6-Feb-03 13:06
mkashifkkj6-Feb-03 13:06 
Generalavaoiding flicker on CUSTOMDRAW Pin
User 98856-Feb-03 12:39
User 98856-Feb-03 12:39 
GeneralRe: avaoiding flicker on CUSTOMDRAW Pin
Moak7-Feb-03 1:09
Moak7-Feb-03 1:09 
GeneralCHeaderCtrl Pin
User 98856-Feb-03 12:30
User 98856-Feb-03 12:30 
GeneralRe: CHeaderCtrl Pin
OBRon7-Feb-03 4:17
OBRon7-Feb-03 4:17 
GeneralRe: CHeaderCtrl Pin
User 98857-Feb-03 4:31
User 98857-Feb-03 4:31 
GeneralCoding database ! Pin
Hadi Rezaee6-Feb-03 11:50
Hadi Rezaee6-Feb-03 11:50 
GeneralRe: Coding database ! Pin
Anonymous6-Feb-03 11:57
Anonymous6-Feb-03 11:57 
GeneralRe: Coding database ! Pin
Hadi Rezaee6-Feb-03 12:21
Hadi Rezaee6-Feb-03 12:21 
GeneralRe: Coding database ! Pin
Willem B7-Feb-03 2:18
Willem B7-Feb-03 2:18 
QuestionGet Network namnes and there IP ? Pin
Larsson6-Feb-03 11:36
Larsson6-Feb-03 11:36 
AnswerRe: Get Network namnes and there IP ? Pin
palbano6-Feb-03 15:20
palbano6-Feb-03 15:20 
GeneralRe: Get Network namnes and there IP ? Pin
Larsson12-Feb-03 5:48
Larsson12-Feb-03 5:48 
GeneralGDI+ and DirectX/direct video output Pin
Roman Nurik6-Feb-03 11:04
Roman Nurik6-Feb-03 11:04 

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.