Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6074409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:22:43+00:00 2026-05-23T10:22:43+00:00

I have a Win32 C++ Application which supports UNICODE. I have a problem where

  • 0

I have a Win32 C++ Application which supports UNICODE. I have a problem where I am using the itoa() function but I get a compile error because I am passing a TCHAR* as the parameter instead of a char*.

What can I do to make it work?

TCHAR buf[32];
itoa( taskState, buf, 10 );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:22:44+00:00Added an answer on May 23, 2026 at 10:22 am

    There is no good reason to us TCHAR unless you’re targeting Windows 9x with MFC in DLL, and you’re sort of afraid to rebuild MFC. Just use wchar_t.

    Then read Microsoft’s documentation of itoa.

    There you find at least one variant that you can use with a wchar_t string.

    It’s generally not a good idea to use itoa family, but you’re at the stage where you have not yet learned to look up the documentation.

    So, that’s what you should do: check the documentation (and yes, I have checked, and it is there).


    Addendum, as of April 2015: Since mid 2011 we’ve had the C++11 and C++14 standards ratified, and compilers now commonly support the C++11 std::towstring function from the <string> header; it’s just as convenient as itoa and more safe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using libcurl in a Win32 C++ application. I have the curllib.vcproj project added
We have an x-files problem with our .NET application. Or, rather, hybrid Win32 and
Simple problem. I'm working on a Delphi 2007/WIN32 application which now uses MS Access
I have a .NET application that makes calls to a native Win32 DLL using
We have a Win32 application that hosts the .NET runtime and opens up .NET
I have a delphi (Win32) web application that can run either as a CGI
I am responsible for a Delphi/Win32 project management application. I have just completed a
I have a C++ application that uses the Win32 API for Windows, and I'm
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I have created a minidump using win32 api [DllImport(DbgHelp.dll, SetLastError = true)] private static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.