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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:29:09+00:00 2026-06-03T19:29:09+00:00

Ok so I am fairly new to C++ and I came across a program

  • 0

Ok so I am fairly new to C++ and I came across a program the can take an exe or a bin file and put it in to a .h file for use with C++. The problem I am having is how can I write the raw data that bin2c genarats to a file and then reproduce that same exe. You can find the code below of the raw data. (Using cygwin to compile.) I was not on a PC so I was not able to use the code tags for showing the code sorry.

const unsigned char raw_data[] = {
    0x21, 0x20, 0xc2, 0xa6, 0xc3, 0xb4, 0xc2, 0xbf,
    0xc3, 0x82, 0xc3, 0x8b, 0xc2, 0xa4, 0x20, 0xc3,
    0x8d, 0xc3, 0x8c, 0x4c, 0x3f, 0x20, 0x20, 0xc3,
    0x80, 0xc3, 0xbf, 0x20, 0x20, 0xc3, 0x80, 0xc3,
    0xbf, 0xc2, 0xa5, 0x20, 0xc5, 0xa1, 0xe2, 0x84,
    0xa2, 0xc2, 0xa9, 0x40, 0x20, 0x20, 0xc3, 0x80,
    0xc3, 0xbf, 0x20, 0x20, 0xc3, 0x80, 0xc3, 0xbf,
    0x60, 0x20, 0x6f, 0x72, 0x20, 0x60, 0x21, 0x20,
    0x48, 0xc2, 0xb7, 0xc3, 0xb4, 0xc2, 0xbf, 0xc3,
    0x82, 0xc3, 0x8b, 0xc2, 0xa4, 0x20, 0xc3, 0x8d,
    0xc3, 0x8c, 0x4c, 0x3f, 0x20, 0x20, 0xc3, 0x80,
    0xc3, 0xbf, 0x33, 0x33, 0x33, 0x3f, 0xc2, 0xa5,
    0x20, 0xc5, 0xa1, 0xe2, 0x84, 0xa2, 0xc2, 0xa9,
    0x40, 0x20, 0x20, 0xc3, 0x80, 0xc3, 0xbf, 0x66,
    0x66, 0xc2, 0xa6, 0x40, 0x0a,
};
  • 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-03T19:29:12+00:00Added an answer on June 3, 2026 at 7:29 pm

    Use the standard C++ I/O gymnastics:

    #include <fstream>
    
    std::ofstream outfile("output.bin", std::ios::binary);
    
    if (!outfile) { /* error, die! */ }
    
    outfile.write(reinterpret_cast<char const *>(raw_data), sizeof raw_data);
    

    You can just declare the array as a const char array and do away with the cast, if you prefer.

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

Sidebar

Related Questions

I am fairly new to SSIS. I came across a situation where i have
I am fairly new to F# and came up across this scenario and was
Fairly new to database schema (plan to use SQLite). Having said that, I'm thinking
I'm fairly new to Ruby but I came across this weird gist where a
fairly new Android developer here. I've come across a strange problem that I'm not
I'm fairly new to C# and I came across an error that I don't
I am fairly new to c# and am trying to write a n-tiered web
I am fairly new to ASP.NET and I discovered repeaters recently. Some people use
I am fairly new to F# and came by the Seq.sortBy function however it
im fairly new to android development, but i'm having some trouble trying to make

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.