title: Cannot find bounds of current function (Code::Blocks) C++
body: <p>I am using the latest version of Code::Blocks. I have a function that passes in a string and a vector. The function compiles with no errors. However, when I run the debugger, it immediately leads me to line 118 (which I have noted) and gives me trouble. The error that comes up says "Cannot find bounds of current function". </p>
  
  <p>Here is the function, which takes in a line of code of a variable declaration (like "var c=0"), and gets the variable of it and adds its value to the vector, v, a struct with an <code>int value</code> and <code>string name</code>:</p>
  
  <pre><code>char get_variable_declaration(string line, vector&lt;variable&gt; &amp;v)
  {
      string b;
      variable t;
      char d[0];
      int counter = 0;
      int a;
      for (int i = 0; i&lt;line.size(); i++) {
          if (line[i] == 'r' &amp;&amp; counter != 1) {
             b[0] = line [i+2];
             counter ++;
          }
          if (line[i] == '=') {
              b[1]=line[i+1];
          }
      }
      t.name = b[0];
      d[0] = b[1];
      a = atoi (d);
      t.value = a;
      v.push_back (t);
      return b[0];
  
      //This function will take in a line of code
      //that is confirmed to have a variable declaration
      //it will add the variable to the list of
      //vectors
  }
  </code></pre>
  
  <p>Here is when it is called:</p>
  
  <pre><code>bool read_code(string file_name, vector&lt;funct&gt; &amp;my_functions, vector&lt;variable&gt; &amp; v)
  {
      vector&lt;string&gt; code;
      string s;
      std::size_t found;
      bool flag;
      funct new_function;
  
      ifstream in;
      in.open(file_name.c_str());
      if(in.is_open())
      {
          //read in file line by line and put it into a vector called code
          while(in.peek()!=EOF)
          {
              getline(in,s);
              code.push_back(s);
          }
          in.clear();
          in.close();
  
          //read through each line of the code, determine if it's a variable or function (definition or call)
          //here it makes reference to functions (listed following this one) which will actually decompose the line
          //for information
          for(int i=0;i&lt;code.size();i++)
          {
              //check if it's a variable declaration
              found = code[i].find("var");
              if(found!=std::string::npos)    //its a variable declaration
                  get_variable_declaration(code[i], v); //ERROR CANNOT FIND..
  
              //check if it's a function. it'll go in the list of functions
              found = code[i].find("funct");
              if (found!=std::string::npos)   //that means it's a function
              {
                  new_function.funct_name=get_function_name(code[i]);
                  new_function.commands.clear();
                  i+=2;   //skip over the open curly brace
                  flag=false;
                  while(!flag)
                  {
                      found = code[i].find("}");
                      if(found==std::string::npos)
                      {
                          new_function.commands.push_back(code[i]);
                          i++;
                      }
                      else
                      {
                          my_functions.push_back(new_function);
                          flag=true;
                      }
                  }
              }
          }
  
          return true;
      }
      else
      {
          cout &lt;&lt; "Cannot locate this file" &lt;&lt; endl;
          return false;
      }
  }
  </code></pre>
  
  <p>Disclaimer: Yes, this is a homework assignment. No, I am not looking for anyone to finish this assignment for me. But, I am still mostly a novice at coding, in need of some assistance, so I ask if you know what is going on, please help me address this issue. Thanks!</p>
  
  <p>Edit: I have gotten this to work on another compiler w/o the text file I am reading from. Not sure if this is a universal issue, or one that the other compiler just didn't pick up on.</p>