c str to float

#include <wchar.h>

int main ()
{
  wchar_t szOrbits[] = L"365.24 29.53";
  wchar_t * pEnd;
  double d1, d2;
  d1 = wcstod (szOrbits,&pEnd);
  d2 = wcstod (pEnd,NULL);
  wprintf (L"%f-------%f
", d1,d2);
  return 0;
}

输出

365.240000-------29.530000
原文地址:https://www.cnblogs.com/sea-stream/p/10823149.html