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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:07:17+00:00 2026-06-11T20:07:17+00:00

I need a quick solution, for this simple task. I am modifying a source

  • 0

I need a quick solution, for this simple task.

I am modifying a source code, which has this function:

OFCondition MdfDatasetManager::saveFile(const char *file_name,
                                        E_TransferSyntax opt_xfer,
                                        E_EncodingType opt_enctype,
                                        E_GrpLenEncoding opt_glenc,
                                        E_PaddingEncoding opt_padenc,
                                        OFCmdUnsignedInt opt_filepad,
                                        OFCmdUnsignedInt opt_itempad,
                                        OFBool opt_dataset)

Inside the function, there is a line:

    result = dfile->saveFile(file_name, opt_xfer, opt_enctype, opt_glenc,
                             opt_padenc,
                             OFstatic_cast(Uint32, opt_filepad),
                             OFstatic_cast(Uint32, opt_itempad),
                             (opt_dataset) ? EWM_dataset : EWM_fileformat);

See the file_name variable?

I want to modify, so the file_name will have “.out” added at the end.

So, I added a new variable:

char *output_file;

And before calling the dfile->saveFile() function, I added:

strcpy(output_file, file_name);
strcat(output_file, ".out");

    result = dfile->saveFile(output_file, opt_xfer, opt_enctype, opt_glenc,
                             opt_padenc,
                             OFstatic_cast(Uint32, opt_filepad),
                             OFstatic_cast(Uint32, opt_itempad),
                             (opt_dataset) ? EWM_dataset : EWM_fileformat);

But, that does not work.

The application crash. And I think, the issue is I need to initialize the *output_file ?

The thing is, I am not C++ programmer 🙁

So, could anyone help?

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-06-11T20:07:18+00:00Added an answer on June 11, 2026 at 8:07 pm

    No memory has been allocated for output_file. Use a std::string instead:

    std::string s(file_name);
    s += ".out";
    

    Then use s.c_str() as the first argument o saveFile() function.

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

Sidebar

Related Questions

I need a quick hand figuring out what this code is doing, and how
I really need some quick tips here. I've got this VBScript script which sends
I am on a problem which need a quick solution. I will try to
I need a quick solution of javascript spell checking. Although all the browsers underlines
I'm looking for a quick cross browser solution to my need for auto margins.
simple and annoying question for you, but i need the answer rather quick and
I have some (small amount) of data that I'll need quick access to on
Need some quick advice I am trying to access a object array but I
need a quick help here. I have a series of hyperlinks all with the
Just need some quick clarification I have 2 Queries in my Access Database that

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.