2

I keep getting process returned -1073741819 (0xc0000005) whenever I run this cod...

 2 years ago
source link: https://www.codeproject.com/Questions/5320668/I-keep-getting-process-returned-1073741819-0xc0000
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

See more:

i keep getting Process returned -1073741819 (0xC0000005) whenever I run this code, what's the reason?

Copy Code
<pre><pre lang="C++"><pre lang="C++">
Copy Code
tr
Expand ▼   Copy Code
bool autoregex(string test){
    regex e ("[-+]?([0-9]*\.[0-9]+|[0-9]+)");
   if (regex_match (test,e))
        return true;

    return false;
}
bool autrege(string test){
    regex aret("SIN|LOG|sqrt|sin|log|tan|pi|e|ln|EE|[^0-9a-z$@#&]");
               if (regex_match (test,aret)){
                return true;
               }

    return false;
               }
               void namehere(string test){
if(autrege(test) == true){
regex bret("[+-]");
regex cret("[/*xX]");
regex dret("SIN|LOG|sqrt|sin|log|tan|pi|!|e|ln|EE|\\^");
regex omega("\\)");
regex canmae("\\(");
if (regex_match (test,bret)){num2 = 1;};
if (regex_match (test,cret)){num2 = 2;};
if (regex_match (test,dret)){num2 = 3;};
if (regex_match (test,omega)){num2 = 4;numaltt = numaltt + 1;};
if (regex_match (test,canmae)){num2 = 4;numalt = numalt + 1;};
}




               }

int main()
{
vector<double> vec;
    again = "n";

 while(again == "n"&&abrt == 0){
        // queue<double> numbers; stack<int> pres;
        queue<string> output;
   int test;
 string name;
   getline(cin, name);
   istringstream iss(name);
 string token;
    while(iss >> token)
    {
      if(autoregex(token) == true){
            output.push(token);
      }
      if(autrege(token)== true)//token area
      {


          namehere(token);
          num6++;
       while(presedence.empty() == 1 && oprators.empty() == 1)
        {
            presedence.push(num2);
            oprators.push(token);
       }
       while(presedence.top() < num2)
        {
        oprators.push(token);
        presedence.push(num2);

       }
while(presedence.top() == num2 && presedence.empty() == 0){
        cout<<"works?"<<endl;cout<<presedence.empty()<<endl;
        cout<<oprators.top()<<endl;
        output.push(oprators.top());
        oprators.pop();
        presedence.pop();
}
       while(presedence.top() > num2)
       {
        output.push(oprators.top());
        oprators.pop();
        presedence.pop();
       }
//3-T 2-ME 
      }

}
while(presedence.empty() != 1 && oprators.empty() != 1){  output.push(oprators.top());
oprators.pop();presedence.pop();}
while(!output.empty()){cout<<output.front()<<", ";output.pop();}

}


What I have tried:

I've tried changing the revamping the entire code to include an error case, tried checking if the stack was empty before popping, didn't work still, I tried removing the precedence system, didn't work, I've got no ideas on what to do now

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK