Saturday, October 26, 2013

String class and the use of char*/const char*

Newsgroup: comp.lang.c++

Subject: String class and the use of char*/const char*

From: goran.pusic@...

Date: Wed, 23 Oct 2013 02:17:22 -0700 (PDT)



Hi all,



we seem to be having a style issue in the team.



We have a string class that has char* and const char* conversion operators

(yes, i know we should be using std::string, please bear with me).



Some people in the team prefer that, when calling code like this:



retval func(..., const char* param, ...);



with an instance of our string class, we use an explicit cast, e.g.



mystring s(whatever);

func(..., (const char*)s, ...);



(as opposed to not using a cast).



Can I please have your opinion on this (good/bad/like/not like)? Insight?

(My purpose, obviously, is to show your responses to the team).



TIA,



Goran.







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?113796-String-class-and-the-use-of-char*-const-char*&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

No comments:

Post a Comment