🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to assign text to a char *buffer ?

#14207
From: Norm Jaffe
Date: Wed, 20 Aug 2003 22:48
13 lines
1359 bytes
[snip]
> If you declare a buffer without initializing it, such as
> char* Buffer;
>
> You cannot use the assignment operator to initialize it:
> Buffer = "Your string 1";            // Error
>
This is perfectly legal.

> You can use strcpy() or strncpy() later to initialize it
Not unless you allocated storage with new[] or malloc.

Norm Jaffe.
Technical Details
Message-ID: <3f43fac3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f43e3f5$1@newsgroups.borland.com> <3f43f466@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,80747dfc78851287
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-20 15:56:30 PST
From: "Norm Jaffe" <mail@aurelsystems.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f43e3f5$1@newsgroups.borland.com> <3f43f466@newsgroups.borland.com>
Subject: Re: How to assign text to a char *buffer ?
Date: Wed, 20 Aug 2003 15:48:35 -0700
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 209.121.213.59
Message-ID: <3f43fac3$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1061419715 209.121.213.59 (20 Aug 2003 15:48:35 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail