String class

Pages: 12
Jun 18, 2009 at 6:13pm
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
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
Nobody can know better than Stroustrup: http://www.research.att.com/~bs/bs_faq2.html#null
Topic archived. No new replies allowed.
Pages: 12