www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/03/14:45:40

From: "Rafal Maj" <maj_rafal AT poczta DOT onet DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: char* as default for constructor ?
Date: Thu, 3 May 2001 19:42:34 +0200
Organization: Academic Computer Center CYFRONET AGH
Lines: 22
Message-ID: <9cs59u$7r1$1@info.cyf-kr.edu.pl>
NNTP-Posting-Host: d-94-53-17.cyfronet.krakow.pl
X-Trace: info.cyf-kr.edu.pl 988911743 8033 149.156.1.177 (3 May 2001 17:42:23 GMT)
X-Complaints-To: news AT cyf-kr DOT edu DOT pl
NNTP-Posting-Date: Thu, 3 May 2001 17:42:23 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi, I have 2 connected questions :
1) Is ther something wrong with using   char *s="test"    in arguments list
of constructor, especialy, when I have separate definiton and declaration of
constructor, like :
  class ccc { ccc(char *S="abc") ; };
  ccc::ccc(char *S="abc) { /* ... */ }
2) Is is quaranteed (<-- BTW. what's spelling of that word ?) that all
strings (char*, const char*) in my project, that are same will have same
adresses in memory ?
Like :
 ***inside library, that is liked into main***
  char *a="abc", *b="abc";  const char *c="abc";
***main***
  main()

    char *d="abc";
    if ((a==b)&&(b==c)&&(c==d)) /* correct ! */  // ????
  }

Thanx in advice...


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019