RE: [Dev-C++] [OT] C++ string vs char *
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2000-12-29 22:37:57
|
If you are talking about C/C++ comparison, string C++ is better to use than char *, since it is a higher level mechanism. Also the myth that C code runs faster and takes less space than C++ is a myth, and usually C++ code is faster than C! Take a look at the following link and look at the end of it with some benchmarks between C & C++ code. http://www.research.att.com/~bs/esc99.html Ioannis > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of > bis...@bt... > Sent: Friday, December 29, 2000 12:05 PM > To: dev...@li... > Subject: [Dev-C++] [OT] C++ string vs char * > > > Hi all > > I'm writing a small application using G++ - this one has a lot of string > manipulation (It is a doxygen-like auto documentation system for a > propreitory language). I seem to have three options: > > a) Use char *s and do my own memory management. > b) Roll by own lightweight string class > c) Use the C++ string class > > Can anyone tell me how good is the string class in terms of > bloat/efficiency > compared to char * ? > Is (b) a viable option if what I want is basically char * with inbuild > memory management ? > > Also, should I use (io|f|str)string ? How much of a > bloat/efficiency concern > is that compared to (f|s)printf/write/read and friends ? > > I don't plan to use the STL stuff. > > Thanks in advance. > Biswa. > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/mailman/listinfo/dev-cpp-users > __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com |