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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:22:35+00:00 2026-06-08T16:22:35+00:00

In C++ I have made a program that exports to binary and now I

  • 0

In C++ I have made a program that exports to binary and now I am making a reader. It reads correctly, but there is only 1 issue. My file is a file that contains a set of numbers and when it is read and printed to the screen you see, 1470009300047000199. The sets of 3 “000” isn’t supposed to be there. I loaded this file using an ifstream and plan to keep it that way. Can someone tell me how to remove the sets of “000” in my file? If I have to write another C++ program that does that I am fine with it, I just need something to remove the “000” and replace it with a space.

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main(int argc, char* argv[])
{
    if (argc < 2)
    {
        cout << "Error 1";
        return 0;
    }
    else
    {
        int FileLength;
        ifstream InputFile(argv[1], ios::binary);
        ofstream OutputFile("DECOMPILED_FILE.txt");
        InputFile.seekg(0, ios::end);
        FileLength = InputFile.tellg();
        InputFile.seekg(0, ios::beg);
        for (int i = 0; i < FileLength; i++)
        {
            cout << InputFile.get();
        }

        cin.get();
    }
    return 0;
}
  • 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-08T16:22:37+00:00Added an answer on June 8, 2026 at 4:22 pm

    How about a regular expression ? Try finding the substring '000' on the file, if found, replace it by ” “.
    Pseudocode:

    for each line in the file do:
         if line.strstr("000") then
               line.replace("000", " ")
    
          cout << line << endl;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a program that continuously monitors a log file. But I don't
My C++ is a little rusty but I have made a program that reverses
I have made a program that reads voltage and current values of some diode
I have made program that detects the face now what i have to do
I have made a program in Java that calculates powers of two, but it
I have made a program that scans rss feeds. This same program creates feeds
I have made a script that uses a program called Diascope, its a video
I have made a batch file that call another one program.bat , the first
I have made a Windows Service that gets installed in a c:\Program Files\My Service
I have a pointer of a structure type that I made. On program start

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.