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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:55:08+00:00 2026-06-02T01:55:08+00:00

I have a C++ program that compiles to 9.5k. I would like it to

  • 0

I have a C++ program that compiles to 9.5k. I would like it to be over 1MB. I did the following to pad it up to about 18k, but doing this all the way to 1MB would be hard.

The code is unreachable, but due to compiler optimizations I had to make it appear reachable, hence the bool changes.

#include "stdafx.h"
#include <iostream>
using namespace std;

void main(int argc, char* argv[])
{
    bool a = false;
    cout << endl << "Passed parameters";
    for (int i = 0 ; i < argc ; i++)
    {
        if(i == 0)
        {
            cout << endl << "Run Path (Arg0): " << argv[i];
            a=true;
        }
        else
        {
            cout << endl << "Arg" << i << ": " << argv[i];
            if(a){a=false;}
        }
    }
    cout << endl << endl;
    system("pause");
    if (a){
    string pad1 = "padpadpadpadpadpadpadpadpadpadpadpadpadpadp1adpadpadpadpadpa";
    string pad2 = "dapdapdapdapdapdapdapdapd2apdapdapdapdapdapdapdapdapdapdapd";
    string pad3 = "dipdipdipdipdipdipdipdipdipdipd3ipdipdipdipdipdipdipdipdip";
    string pad4 = "dipdipdipdi4pdipdipdipdipdipdipdipdipdipdipdipdipdipdipdip";
    string pad5 = "dipdipdipd5ipdipdipdipdipdipdipdipdipdipdipdipdipdipdipdip";
    string pad6 = "dipdipdipd6ipdipdipdipdipdipdipdipdipdipdipdipdipdipdipdip";
    string pad7 = "dipdipdipd7i1pdipdipdipdipdipdipdipdipdipdipdipdipdipdipdip";
    string pad8 = "dipdipdip8dipdipdip1dipdipdipdipdipdipdipdipdipdipdipdipdip";
    string pad9 = "dipdipdipd9ipdipdipdipdip1dipdipdipdipdipdipdipdipdipdipdip";
    string pad10= "padpadpadpadpadpadpadpadpadpadp1adpadpadpadp1adpadpadpadpadpa";
    string pad11= "dapdapdapdapdapdapdapdapd2apdapdapdapdapdap1dapdapdapdapdapd";
    string pad12= "dipdipdipdipdipdipdipdipdipdipd3ipdipdipdipdipdipdip1dipdip";
    string pad13= "dipdipdipdi4pdipdipdipdipdipdipdipdipdipdipdipdipdi1pdipdip";
    string pad14= "dipdipdipd5ipdipdipdipdipdipdipdipdipd2ipdipdi1pdipdipdipdip";
    string pad15= "dipdipdipd6ipdipdipdip2dipdipdipdipdipdipdip1dipdipdipdipdip";
    string pad16= "dipdipdipd7ipdipdipdip2dipdipdipdipdip1dipdipdipdipdipdipdip";
    string pad17= "dipdipdip8dipdipdipdipdipdipd2ipdip1dipdipdipdipdipdipdipdip";
    string pad18= "dipdipdipd9ipdipdipdip1dipdipdipdipdipdi2pdipdipdipdipdipdip";
    string pad19= "padpadpadpadpadpadpadpadpadpadpad2padpadpadp1adpadpadpadpadpa";
    string pad20= "dapdapdapdapdapd2apdapdapd2apdapdapdapdapdapdapdapdapdapdapd";
    string pad21= "dipdipdipdipdipd2ipdipdi2pdipdipd3ipdipdipdipdipdipdipdipdip";
    string pad22= "dipdipdipdi4pdipdipdipd2ipdipdipdipdipdipdipdipdipdipdipdip";
    string pad23= "dipdipdipd5ipdip2dipdipdipdipdipdipdipdipdipdipdipdipdipdip";
    string pad24= "dipdipdipd6ipdipdipdi2pdipdipdipdipdipdipdipdipdipdipdipdip";
    string pad25= "dipdipdipd7i1pdipdipdipdipdipdip2dipdipdipdipdipdipdipdipdip";
    string pad26= "dipdipdip8dipdipdip1dipdipdip1dipdipdipdipdipdipdipdipdipdip";
    string pad27= "dipdipdipd9ipdipdipd1ipdip1dipdipdipdipdipdipdipdipdipdipdip";
    string pad28= "padpadpadpadpadpadpadpadp1adpadp1adpadpadpadp1adpadpadpadpadpa";
    string pad29= "dapdapdapdapdapdapdapdapd2apdapdapdapdapda1p1dapdapdapdapdapd";
    string pad30= "dipdipdipdipdipdipdipdipdipdipd3ipdipd1ipdipdipdipdip1dipdip";
    string pad31= "dipdipdipdi4pdipdipdipdipdipdipdi1pdipdipdipdipdipdi1pdipdip";
    string pad32= "dipdipdipd5ipdipdipdi1pdipdipdipdipdipdipdipdi1pdipdipdipdip";
    string pad33= "dipdipdipd6ipdipdipdip1dipdipdipdipdipdipdip1dipdipdipdipdip";
    string pad34= "dipdipdipd7ipdipdipdipdip1dipdipdipdip1dipdipdipdipdipdipdip";
    string pad35= "dipdipdip8dipdipdipdipdipdipdi1pdip1dipdipdipdipdipdipdipdip";
    string pad36= "dipdipdipd9ipdipdipdip1dipdipdipd1ipdipdipdipdipdipdipdipdip";}
    return;
}
  • 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-02T01:55:10+00:00Added an answer on June 2, 2026 at 1:55 am

    Try this:

    char waste[1024*1024] = {1};
    

    At least on my TDM-GCC (on Win7), the output is 1 MB bigger; if you write

    char waste[1024*1024] = {0};
    

    it’ll be optimized out (resulting in 27kB).

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

Sidebar

Related Questions

I have an MPI program which compiles and runs, but I would like to
I have quite a 'heavy' python program that I would like compiled to an
I have a Win32 program that runs on a loop. I would like to
I have a system that compiles C# code at runtime. I would like the
I have a program that performs some network IO that compiles a 32 bit
I have a program that looks something like this: public partial class It {
For about a year I have been thinking about writing a program that writes
I have written a small makefile for a few simple C programs that compiles
I have a program that is written in Ada, and I need to compile
I have program that has a variable that should never change. However, somehow, it

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.