From: "Rafal Maj" Newsgroups: comp.os.msdos.djgpp Subject: Odp: char* as default for constructor ? Date: Thu, 3 May 2001 19:52:05 +0200 Organization: Academic Computer Center CYFRONET AGH Lines: 36 Message-ID: <9cs5rl$cc3$1@info.cyf-kr.edu.pl> References: <9cs59u$7r1$1 AT info DOT cyf-kr DOT edu DOT pl> NNTP-Posting-Host: d-94-53-01.cyfronet.krakow.pl X-Trace: info.cyf-kr.edu.pl 988912310 12675 149.156.1.161 (3 May 2001 17:51:50 GMT) X-Complaints-To: news AT cyf-kr DOT edu DOT pl NNTP-Posting-Date: Thu, 3 May 2001 17:51:50 +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 In 2-nd question, I ofcourse ment ONLY strings that are immediate (<- BTW, speling ?) values, like const char *s="..."; or char *s="..."; If answer to my 2-nd question is yes, then is it safe to compare immediante char strings using normal operator= ? Użytkownik Rafal Maj w wiadomości do grup dyskusyjnych napisał:9cs59u$7r1$1 AT info DOT cyf-kr DOT edu DOT pl... > 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... > >