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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:10:10+00:00 2026-05-28T14:10:10+00:00

I have an array problem that i want to overcome, if i change the

  • 0

I have an array problem that i want to overcome, if i change the value of const int “are” to 2048 the program runs fine but at 8192 or even at 4096 ( just 130,000 elements) it does not work and breaks. How do i get around this ?

#include <iostream>
#include <fstream>
#include <windows.h>

#pragma warning (disable : 4820 4619 4668 4101)

HANDLE ghEvents;

const int arc = 2048; 
const int are = 8192;

struct DataStructure_init {

    int main_seq[are][32];
    int main_seq2[are][32];
    int main_seq3[are][32];
    int main_lim[are];

};

struct DataStructure_trus {
    int net[arc]; 
    int  r6[arc];
    int thr[arc];
};

int ftrus (unsigned char cmain[],int array_inst[],DataStructure_trus& va);
int finit (DataStructure_trus va,DataStructure_init& in);

using namespace std;

int main()
{
    unsigned char cmain[are];
    int array_inst[64]={0};
    DataStructure_trus va; 
    DataStructure_init in;
    ftrus(cmain,array_inst,va);
    finit(va,in);

    cin.get();
}



int finit (DataStructure_trus va,DataStructure_init& in)
{

    int nb=0,flag=0,lock=0;

    for(int i=0;i<are;i++){

        for(int j=0;j<24;j++){
        in.main_seq[i][j]=va.thr[(i*24)+j];
        }

    }

    return 0;
}



int ftrus (unsigned char cmain[],int array_inst[],DataStructure_trus& va)
{

    int g=0; 
    ifstream in("C:\\Dev-Cpp\\DCS\\Decom\\trus.txt", ios::binary);
    unsigned char c;
    while( in.read((char *)&c, 1) )
    {       
            cmain[g]=c;
            if(cmain[g]==' ' && cmain[g-1]=='t' && cmain[g-2]=='e' && cmain[g-3]=='n')      {array_inst[1]=g+1;}
            else if(cmain[g]==' ' && cmain[g-1]=='r' && cmain[g-2]=='h' && cmain[g-3]=='t') {array_inst[9]=g+1;array_inst[21]=g-7;}
            g++;
    }
    array_inst[29]=g-2;

    for(int i=0;i<64;i++){va.r6[i]=0;}

    for(int i=array_inst[1];i<array_inst[21];i++){
        if(cmain[i]=='1'){va.net[va.r6[1]]=1;va.r6[1]++;}
                    else {va.net[va.r6[1]]=0;va.r6[1]++;}
    }

    for(int i=array_inst[9];i<array_inst[29];i++){
        if(cmain[i]=='1'){va.thr[va.r6[9]]=1;va.r6[9]++;}
                    else {va.thr[va.r6[9]]=0;va.r6[9]++;}
    }


    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-05-28T14:10:11+00:00Added an answer on May 28, 2026 at 2:10 pm

    You don’t have to put the arrays on the stack in main(), you can just as well allocate them statically before entering the function. That will put them in an area that is not limited by the default stack size.

    unsigned char cmain[are];
    int array_inst[64]={0};
    DataStructure_trus va;
    DataStructure_init in;
    
    int main() {
       ftrus(cmain,array_inst,va);
       finit(va,in);
       cin.get();
     }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem. I have an array of bytes that I want
I have a pretty simple problem. Basically I have an array called $list that
I have a little problem, I have an array and I want to add
I have a problem initializing an array whose size is defined as extern const.
I’m working on a multi dimensions array but i have a problem Imagine I
I have an array in C that I want to address in manner similar
somewhat simple problem(to explain) this time: i have an array of markers that i
I have a problem with getting some html value stored in a php array:
The problem is that I have an Array of Byte with 200 Indexes and
For example, i have an array in CodeBehind, that i want to bind to

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.