Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Bug in String/Stream or just misleading documentation?
Bug in String/Stream or just misleading documentation? [message #14014] Wed, 06 February 2008 18:19 Go to previous message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
String documentation says that String contains an array of characters which is zero-terminated. This suggests that a String cannot contain '\0's.

On the other hand Stream documentation says:

Quote:

void Put(const String& s)
Writes String to the the stream. String can contain zero characters.
s String to write.


This can either mean that s can indeed contain '\0's or that "s.GetLength() == 0" is valid.

While the latter case seems trivial to me, the first case doesn't work as outputting a String with an appended '\0' swallows the trailing '\0'.

So, what is correct?

No '\0's inside a String and "a_stream.Put("");" is valid?

Or '\0's inside a String are valid and "Put(const String& s)" is buggy?

Werner
 
Read Message
Read Message
Read Message
Previous Topic: Real newbie question about copying values
Next Topic: What does Vector::GetIndex do?
Goto Forum:
  


Current Time: Sun Apr 27 22:15:11 CEST 2025

Total time taken to generate the page: 0.00695 seconds