Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > string and const char

Reply
Thread Tools

string and const char

 
 
Juha Nieminen
Guest
Posts: n/a
 
      07-30-2010
Michael Doubez <(E-Mail Removed)> wrote:
> Yes. I meant they are the headers inherited from C and not for
> backward compatibility reason (contrary to pre-standard stl headers
> which are deprecated).


My point was that there exist two sets of "C" headers: Those which
use the same name as C (eg. "stdio.h") and those which use the C++
variant ("cstdio"). They are not simply two names for the same thing,
but the former actually do something differently than the latter
(namely, putting everything into the global namespae). My point was
that the former was included in the standard to keep compatibility
with pre-standard programs (which typically included <stdio.h> and
assumed everything was in global namespace instead of including <cstdio>
and assuming the symbols are in the std namespace).
 
Reply With Quote
 
 
 
 
Michael Doubez
Guest
Posts: n/a
 
      07-30-2010
On 30 juil, 14:12, Pete Becker <(E-Mail Removed)> wrote:
> On 2010-07-30 06:46:53 -0400, Juha Nieminen said:
>
> > Michael Doubez <(E-Mail Removed)> wrote:
> >> Yes. I meant they are the headers inherited from C and not for
> >> backward compatibility reason (contrary to pre-standard stl headers
> >> which are deprecated).

>
> > * My point was that there exist two sets of "C" headers: Those which
> > use the same name as C (eg. "stdio.h") and those which use the C++
> > variant ("cstdio"). They are not simply two names for the same thing,
> > but the former actually do something differently than the latter
> > (namely, putting everything into the global namespae). My point was
> > that the former was included in the standard to keep compatibility
> > with pre-standard programs

>
> It's there to keep compatibility with C code. All of it, not just pre-standard.


I have noticed that in the current standard[98], the D annexe that
specify it is identified by [depr] and relevant section is
[depr.c.headers].

What 'depr' stands for ?
(I am thinking hard 'deprecated' but since the annex starts with
deprecated features, it may be only an unfortunate naming )

--
Michael
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
const vector<A> vs vector<const A> vs const vector<const A> Javier C++ 2 09-04-2007 08:46 PM
the difference between "const char* s" and "char* const s" Gary C Programming 9 08-24-2006 09:57 PM
(const char *cp) and (char *p) are consistent type, (const char **cpp) and (char **pp) are not consistent lovecreatesbeauty C Programming 1 05-09-2006 08:01 AM
Is char** (or char*[]) implicitly convertible to 'const char * const *'? kevin.hall@motioneng.com C Programming 24 10-30-2005 08:07 AM
Exact difference between 'const char *' and 'char *', also diff between 'const' and 'static' Santa C Programming 1 07-17-2003 02:10 PM



Advertisments