cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
String class
Page 2
String class
Pages:
1
2
Jun 18, 2009 at 6:13pm UTC
firedraco
(6242)
I think you could have said that a bit better, but...use string::npos, don't use -1. It's like assuming NULL is equal to 0...when it could easily be some memory address the OS defines to catch NULL pointers.
Jun 18, 2009 at 6:29pm UTC
Zhuge
(4664)
Well, if I recall correctly, the standard says that assigning a pointer to zero must map to an adress the OS uses for null pointers.
Jun 18, 2009 at 9:00pm UTC
Bazzy
(6281)
Nobody can know better than Stroustrup:
http://www.research.att.com/~bs/bs_faq2.html#null
Topic archived. No new replies allowed.
Pages:
1
2