Home > Archive > VC Language > June 2005 > atof
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hi all,
Is there a generic-text routine mapping for atof, or a unicode equivalent??
Thanks
Srishti
| |
|
| Also, is there a mapping (generic/unicode) for _gcvt
"Sonu" wrote:
> Hi all,
> Is there a generic-text routine mapping for atof, or a unicode equivalent??
> Thanks
> Srishti
| |
| Igor Tandetnik 2005-05-29, 3:58 pm |
| "Sonu" <sonu@online.nospam> wrote in message
news:814D7AB9-66C3-4812-982E-E44576F73509@microsoft.com...
> Is there a generic-text routine mapping for atof, or a unicode
> equivalent??
_wtof, _tstof
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
| |
| Yan-Hong Huang[MSFT] 2005-05-30, 9:00 am |
| Hi Srishti,
My suggestion is to use the following functions:
swprintf
sprintf
It doesn't map _gcvt directly, but it should be OK for converting a float
to a wide string.
Please try it and let us know whether that is what you need. Thanks very
much.
Best regards,
Yanhong Huang
Microsoft Community Support
Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
| |
|
| My compiler says that _wtof & _tstof are "undeclared identifiers".
I am working in VC 6.0 and I not sure which version of msvcrt.dll or
mfc42.dll I'm using, but do I need to #include something for these routines???
Thanks a lot for your reply
Srishti
"Igor Tandetnik" wrote:
> "Sonu" <sonu@online.nospam> wrote in message
> news:814D7AB9-66C3-4812-982E-E44576F73509@microsoft.com...
>
> _wtof, _tstof
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>
| |
| Igor Tandetnik 2005-05-31, 4:02 am |
| "Sonu" <sonu@online.nospam> wrote in message
news:8D6A9512-61A6-416B-BFFA-BD3A2CF611A1@microsoft.com
> My compiler says that _wtof & _tstof are "undeclared identifiers".
>
> I am working in VC 6.0
Yes, it does appear that these functions are new in VC7.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
| |
| Barry Schwarz 2005-05-31, 4:02 am |
| On Mon, 30 May 2005 10:10:02 -0700, "Sonu" <sonu@online.nospam> wrote:
>My compiler says that _wtof & _tstof are "undeclared identifiers".
>
>I am working in VC 6.0 and I not sure which version of msvcrt.dll or
>mfc42.dll I'm using, but do I need to #include something for these routines???
>Thanks a lot for your reply
If it is a compiler message, then the dll is irrelevant because that
is used at link and run times, not during compilation.
FWIW, VC 6 does not show any entry for either identifier, with or
without the underscore.
<<Remove the del for email>>
| |
| Gary Chang[MSFT] 2005-05-31, 9:14 am |
| Hi Srishti,
The VC6's library doesn't have _wtof, it only has the _wtoi, _wtoi64, _wtol
functions.
If you need to convert a wide string into a float number, how about use the
WideCharToMultiByte to convert the Unicode string to ANSI string first,
then call the atof...
Thanks for your understanding!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/defaul...msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
| |
|
|
Thanks all,
I think I'll just compile my program in VC7 then, (though I don't like the
new interface, I guess I'm sort of attached to VC6 but... I'll get used to
the new one )
Thanks again
Regards
Srishti
| |
| Gary Chang[MSFT] 2005-06-01, 4:00 am |
| It's OK, Srishti, wish you will have a great experience with the VC7:)
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/defaul...msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
| |
| Simon Trew 2005-06-02, 4:02 am |
| By the way, swprintf is not very portable. (Some implementations take a size
parameter, some don't.) Also, both are marked deprecated in VC8b2.
| |
| Simon Trew 2005-06-02, 4:02 am |
| My mistake, it's not marked deprecated. But in both stdio.h and wchar.h (for
VC8) there is this comment:
/* This non-standard definition exists for historical reasons to avoid
breaking old code */
_CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...);
"Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> wrote in message
news:wQyS0ZOZFHA.3052@TK2MSFTNGXA01.phx.gbl...
> Hi Srishti,
>
> My suggestion is to use the following functions:
> swprintf
> sprintf
>
> It doesn't map _gcvt directly, but it should be OK for converting a float
> to a wide string.
>
> Please try it and let us know whether that is what you need. Thanks very
> much.
>
> Best regards,
> Yanhong Huang
> Microsoft Community Support
>
> Get Secure! ¨C www.microsoft.com/security
> Register to Access MSDN Managed Newsgroups!
> -http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
> p&SD=msdn
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
| |
|
| Wow!!!
"Simon Trew" wrote:
> My mistake, it's not marked deprecated. But in both stdio.h and wchar.h (for
> VC8) there is this comment:
>
> /* This non-standard definition exists for historical reasons to avoid
> breaking old code */
>
> _CRTIMP int __cdecl swprintf(wchar_t *, const wchar_t *, ...);
>
> "Yan-Hong Huang[MSFT]" <yhhuang@online.microsoft.com> wrote in message
> news:wQyS0ZOZFHA.3052@TK2MSFTNGXA01.phx.gbl...
>
>
>
|
|
|
|
|