U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » signature of the stou function
Re: signature of the stou function [message #876 is a reply to message #873] Mon, 06 February 2006 14:26 Go to previous messageGo to previous message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
stou returns 0xFFFFFFFF in case of error. Maybe that could be considered as Null for unsigned.
Anyway I think that converting a string to unsigned int, signed int, and double are similar operations and should have similar interface for the client code. So if you can not or do not want to provide an invalid return value, then one more parameter should be added for success indication, or the client code should check the endptr to see if the conversion succeeded. It is not really intuitive for the client programmer to call stou and check for 0xFFFFFFFF for unsigned integers, and call ScanInt and check for Null for signed integers.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: bits/atomicity.h
Next Topic: Xmlize and double
Goto Forum:
  


Current Time: Sun Apr 26 18:17:45 GMT+2 2026

Total time taken to generate the page: 0.01109 seconds