🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9441

Re: But why not use ?

#9441
From: Remy Lebeau (TeamB)
Date: Wed, 07 Jul 2004 18:41
25 lines
1755 bytes
"Edward" <Registrados2004@aol.com> wrote in message
news:40ec3a05@newsgroups.borland.com...

>   char biosnro[256];
>
>   memset(biosnro,' ', strlen(biosnro));

That is wrong.  You didn't assign any string to biosnro yet, thus you cannot
use strlen() here.  Use sizeof() instead:

    memset(biosnro,' ', sizeof(biosnro));

BTW, why use ' ' instead of '\0'?  Then you wouldn't even need memset at
all:

    char biosnro[256] = {0};

> But why not use ?

Because it is not necessary to loop manually when there are already
provisions that do the same intializations for you.


Gambit
Technical Details
Message-ID: <40ec43ca$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40c86e9e@newsgroups.borland.com> <40eb41eb$1@newsgroups.borland.com> <40eb8d7b$1@newsgroups.borland.com> <40ec23f0@newsgroups.borland.com> <40ec2bad$3@newsgroups.borland.com> <40ec3a05@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e3066f787953dff9
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40c86e9e@newsgroups.borland.com> <40eb41eb$1@newsgroups.borland.com> <40eb8d7b$1@newsgroups.borland.com> <40ec23f0@newsgroups.borland.com> <40ec2bad$3@newsgroups.borland.com> <40ec3a05@newsgroups.borland.com>
Subject: Re: But why not use ?
Date: Wed, 7 Jul 2004 11:41:41 -0700
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.10
Message-ID: <40ec43ca$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1089225674 68.69.17.10 (7 Jul 2004 11:41:14 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail