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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:11:44+00:00 2026-06-07T02:11:44+00:00

I am working on a C# program that produces a very large piece of

  • 0

I am working on a C# program that produces a very large piece of C code. It produces a .c file and accompanying header file. On a very basic level, the program accepts a string from the user, then compares it to thousands of other strings that have been placed in the header file during autogen.

The header file contains over 800k lines of code and the .c file contains around 300k. As you can imagine, these are very large files. Now, I realise that having such a large file is bad coding practice. The best thing would be to break this file down into smaller files and compile it that way, but can we assume that this two file structure is necessary for how my project will be used in the grand scheme of things.

With that in mind, I’m having trouble compiling this program in the Visual Studio IDE and with the command line. Infact, that’s not entirely true. It appears to compile okay each time I try it with either method (admittedly it takes a while). However, when I come to run the program, problems develop. It reaches the input loop just fine, but after accepting user input, the program crashes with the following error:

“Unhandled exception at 0x008105f9 in Prototype.exe: 0xC0000005: Access violation writing location 0x00000000.”

I’m fairly sure this is not my code causing the problem. I have run a version of this code generated in debug mode which is a lot smaller and it runs fine. The only difference is the volume of strings that have been written to the header file by the C# program. The size of the smaller files are 14k and 5k lines respectively. Also, the IDE does not allow me to use breakpoints to debug after compiling and running with the full sized code, whereas my smaller code does.

My question would be this: Is there any limit or issue that the C language or the Visual Studio compiler has with single large files that would be causing the error above? If so, is there any way to circumvent this limit while retaining my two-file structure? I have tried increasing heap and stack sizes to 4mb in the properties dialouge, but this does not help.

I realise that this is an abnormal way to produce and run code, but I would be appreciative of any advice.

  • 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-07T02:11:46+00:00Added an answer on June 7, 2026 at 2:11 am

    I realise that having such a large file is bad coding practice

    No, it is not.

    Having a file with LOGIC that is MANUALL MAINTAINED like that is bad practice.

    Having a hugh file of constants is ARGUABLE,

    but having a generated file like that does not show up on coding practices BECAUSE YOU DO NOT CODE IT. You generate it.

    There are good points in having few files for generated code, such as ease of generation. VS.ENT does that iteself – EntityFramework etc. generate ONE cs file with tons of classes, all from one input model.

    Is there any limit or issue that the C language or the Visual Studio compiler has with single arge
    files that would be causing the error above?

    Nothing documented. You likely run into a bug few people ever see. I fear you are in for a rewrite OR – a PSS Support case (Microsoft Support Services), which likely is free if you found a compiler bug.

    Alternatively it MAY be your code – if your debug cases are a lot smaller, it may be your code produces an error with the full data set, which IS more likely than a compiler issue.

    I would suggest you make a debug run with the FULL files, not a small set. The debugger may point you to a surprising location.

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

Sidebar

Related Questions

I'm working on a program that reads in users input as a string, which
I'm working on a program that takes in a Wavefront .obj file and eventually
I'm currently working on a program that analyses a wav file of a solo
I have a program that is very large scale (tens of thousands of lines
I'm working on a program that will sort files based on extension I currently
I'm working on a program that asks for input, then calculates and posts the
I am working on a program that uses IE to display its help pages.
I'm working on a program that will need to delete a folder (and then
I'm working on a program that creates thumbnails of JPEG images on the fly.
I'm working on a program that accesses StarTeam using the StarTeam SDK for .NET.

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.