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 7044205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:22:55+00:00 2026-05-28T02:22:55+00:00

I am trying to compile in visual studio 2010, and this is the exact

  • 0

I am trying to compile in visual studio 2010, and this is the exact error I get:

Error 65 error C2440: 'function' :
       cannot convert from 'double' to 'const wchar_t *'    

The offending line being:

swprintf(subbuf[num], L"%f\0", va_arg(args, double));

This is supposed to compile cleanly so code changes are not recommended.
Am I missing any compiler option which might resolve this?

EDIT:

Here is the declaration of subbuf:

#define GDB_CHAR wchar_t
GDB_CHAR subbuf[MAX_SUBS][STATUS_MSG_LEN+1] ;

Also, regarding the size argument, I also checked the documentation page, however, compiler
doesn’t throw an error on

swprintf(subbuf[num], L"%c\0", va_arg(args, int));

So it has no issues in converting from int to wchar_t * and the function’s arguments are ok.

If this is still not informative enough, please comment and direct me to any other you guys need.
Thanks

  • 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-28T02:22:56+00:00Added an answer on May 28, 2026 at 2:22 am

    A quick glance at the documentation shows that the function requires an argument specifying the size of the output string, which you have omitted.

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

Sidebar

Related Questions

I am trying to build the cpp-netlib library from Visual Studio 2010 but get
When trying to compile my class I get an error: The constant 'NamespaceName.ClassName.CONST_NAME' cannot
I was trying to compile our project in Visual Studio 2010 using the 2005
So I'm trying to compile a project in Visual Studio 2010 and I seem
I am trying to compile JRTPLIB in Visual Studio 2010 on windows 7. It's
I am trying to compile a program that is created from Visual Studio 8,
I'm trying to compile Thrift and run it on Visual Studio 2010. The thing
I'm trying to compile an old project that was originally designed for Visual Studio
I'm trying to make my project compile under GCC (Visual Studio compiles it flawlessly).
Trying to compile a iPhone/iPad application with SDK3.2 and am getting this error: Undefined

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.