-1

I have the following line of code:

(total_time== 0xAAAABBBB) ? ("") : _ui64toa_s(total_time, myArray, 1024, 10);

As the title suggests, I receive this error:

error C2446: ':' : no conversion from 'errno_t' to 'const char *'

I am unsure how to convert errno_t to const char *.

I tried to solve it by writing

 const char *n = _ui64toa_s(total_time, myArray, 1024, 10);

only to see this:
error C2440: 'initializing' : cannot convert from 'errno_t' to 'const char *'

user3555181
  • 117
  • 4
  • 11

1 Answers1

0

_ui64toa_s does not return a string like _ui64toa does.

Instead it returns an errno_t which is defined as int.

errno_t e = _ui64toa_s(total_time, myArray, 1024, 10);

But since you're using C++ I recommend you use std::to_string instead.

std::to_string(total_time).c_str();

You might also want to take a look at this question.

Community
  • 1
  • 1
Axalo
  • 2,953
  • 4
  • 25
  • 39