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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:07:53+00:00 2026-06-06T02:07:53+00:00

Having a weird problem sprintf(tmp, \%s\, filename); I expect the output to be filename

  • 0

Having a weird problem

sprintf(tmp, "\"%s\"", filename);

I expect the output to be

"filename"

but instead I get

\"filename\"

What is going on here?

=============================

extern "C" void __export __pascal MyFunc(LPTSTR m_avi, LPTSTR m_mpg)
{
  int frameRate = 20;
  char szAVI[MAX_PATH], szMPG[MAX_PATH];

#ifdef UNICODE
  wcstombs(szAVI, m_avi, _tcslen(m_avi) + 1);
  wcstombs(szMPG, m_mpg, _tcslen(m_mpg) + 1);
#else
  strcpy(szAVI, m_avi);
  strcpy(szMPG, m_mpg);
#endif

  //Call to ffmpeg.exe
  char cmdline[1000] = "ffmpeg ", tmp[50];

  //Overwrite without asking
  strcat(cmdline, "-y ");

  //Input file
  sprintf(tmp, "-i \"%s\" ", szAVI);
  strcat(cmdline, tmp);

  //Lock output at 20 frames per second
  sprintf(tmp, "-r %i ", frameRate);
  strcat(cmdline, tmp);

  //Output file
  sprintf(tmp, "\"%s\"", szMPG);
  strcat(cmdline, tmp);

  WinExec(cmdline, SW_HIDE);
}
  • 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-06-06T02:07:55+00:00Added an answer on June 6, 2026 at 2:07 am

    Since the code you’ve shown doesn’t actually produce any output, I suspect the “output” you’re talking about is coming from your debugger, where you’re attempting to inspect the value of your array before you call WinExec.

    Debuggers often display the values of variables using the syntax of the language being debugged. The debugger in this case is showing you that the string variable contains quotation marks. Since quotation marks are special in C++, the debugger also displays backslashes to indicate that the quotation marks are part of the string’s contents, not denoting the start or end of a string value.

    If you’re seeing backslashes in the debugger, then everything’s fine. If you’re seeing backslashes printed out or displayed somewhere in your program, then you need to go look at that code since the code here in the question doesn’t display anything.

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

Sidebar

Related Questions

Super weird problem here. I'm having trouble getting jQuery to bind any selectors except
I'm having a weird problem with a threaded class using Boost::threads. Here is a
I having a weird problem with Entity Framework with MySql database. Here's the code
i'm having an weird problem, my project have a login page, that's working, but
I am trying to write the manifest file but I am having weird problem
Having a weird problem here. Everybody knows that if you use web.config's customErrors section
I am having a weird problem here, and I am really stuck, need to
I am having this weird problem where everything seems to work as expected but
I'm having quite a weird problem here. I have just pasted the Yii folder
I am having a weird problem here, and I am really stuck, need to

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.