Hi! what's the fastest way to convert a CString into an int?
thx.
This is a discussion on CString ---> Int within the Windows Programming forums, part of the Platform Specific Boards category; Hi! what's the fastest way to convert a CString into an int? thx....
Hi! what's the fastest way to convert a CString into an int?
thx.
Some useless programs i've wrote : slprogrammersheaven
My amature IT Blog: http://everything-geeky.blogspot.com/
My Flash games: http://flashweed.blogspot.com/
(and, sorry for my amature english in the posts)
Do you have a particular need for 'fast as possible', or will one of the normal ways work?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
hi,
normal ways will work. i just want to know if there is a way to convert CString to an int without transferring the value into a c-style string 1st and using atoi().
thx.
Some useless programs i've wrote : slprogrammersheaven
My amature IT Blog: http://everything-geeky.blogspot.com/
My Flash games: http://flashweed.blogspot.com/
(and, sorry for my amature english in the posts)
atoi() the CString is what I do.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
If you are using MFC/ATL there are several conversion functions provided inside of ATL. Of course using these forces your app to rely on them. Look them up in your help file under ATL or under CString. I think CString has a link in the help file that leads to the right page.
Other than that and what has already been suggested there really is no elegant way to convert a CString. CString is a very nice class but unfortunately it is closely tied into MFC and thus outside of that becomes a pain in the arse to use.