Q:

Should I use a map, 3D array, or stick with a stack?

So far I can get this to work perfectly for every case except when there are more open braces than closed braces. Whenever the stack still contains any open braces I don't know how to find that particular open brace. I was wondering if including a map or changing my stack to take in 3D(?) array values so it can contain the coordinates of the char? If there is an easier way it would be nice if you guys could help guide me toward it please don't just tell me the answer because I'm stuck as to how I'm supposed to make it work. ;-;
Thank you so much!
    void Brackets::check_bracket()
        {
            for (int a = 0; a < line_num; a++)//loops through every line
            {
                for (int c = 0; c < lines[a].length(); c++)//loops through every char in string
                {
                    while (lines[a].find("//") != -1 || lines[a].find("cout") != -1) a++;//checks if there is a comment
                    if (lines[a][c] == '(' || lines[a][c] == '[' || lines[a][c] == '{')//checks if the brace is an open brace
                    {
                        //DBG::cout << "yes" << lines[a][c] << endl;
                        bracket.push(lines[a][c]);//if yes then it pushs the brace in
                    }
                    if (lines[a][c] == ')' || lines[a][c] == ']' || lines[a][c] == '}')//checks if the brace is a close brace
                    {
                        //DBG::cout << bracket.empty() << lines[a][c] << endl;
                        if (bracket.empty())
                        {//if empty then tells user the bracket does not match any open parenthesis
                            //DBG::cout << 1;
                            cout << "closed parenthesis " << lines[a][c] << " does not match any open parenthesis.";
                            return;
                        }
                        //else if the brackets do match an open brace then it pops it out
                        else if ((lines[a][c] == ')' && bracket.top() == '(') || (lines[a][c] == ']' && bracket.top() == '[') || (lines[a][c] == '}' && bracket.top() == '{'))
                        {
                            //DBG::cout << 2;
                            bracket.pop();
                        }//checks if bracket matches any open parenthesis
                        else
                        {
                            //DBG::cout << 3 << a << endl;
                            cout << "Line " << a+1 << ":" << " error at column " << c+1 << ":" << endl;
                            cout << lines[a] << endl;
                            for (int o = 0; o < c; o++)
                                cout << " ";
                            cout << "^" << endl;
                            cout << "closed parenthesis " << lines[a][c] << " does not match open parenthesis " << bracket.top() << " from row " << find_last(a, bracket.top());
                            return;
                        }
                    }
                }
            }
            if (!bracket.empty())//if bracket still contains something in the stack then it finds where the leftover open brace is
            {
                cout << "Unmatched open parenthesis " << bracket.top() << " at row "; //im stuck
            }
            else
            cout << "No parenthesis errors."<<endl;//otherwise no parenthesis errors
        }
        //finds the last problem brace
        string Brackets::find_last(int line, char chk)
        {
            string row_col = "";
            for (int a = line; a >= 0; a--)//loops through lines backwards
            {
                for (int b = lines[a].length() - 1; b >= 0; b--)//loops through length backwards
                {
                    if (lines[a][b] == chk)//checks if the char equals the problem brace
                    {
                        row_col = to_string(a+1) + " and column " + to_string(b+1)+"\n";//returns string of location
                        return row_col;
                    }
                }
            }
            return "";
        }

private:
    string lines[1000];//contains code lines
    int line_num = 0;//number of lines
    stack<char> bracket;//brackets

A:

Are you just looking for matching braces?
Stick with a stack but store a struct instead of only the char; like Stefan suggested. Since brackets are inherently stack-like in nature, i.e. the more open brackets you have the deeper in the stack you go while closing brackets pops the stack. So ideally, you should have and empty stack when all is right. The reason you'll use a struct instead of just the char is so you can retain more information about the bracket. 
3D arrays will use too much contiguous space for what you want to do. If your parsing a large file or multiple files it'll get pretty bad.
Map is not as bad but not ideal for this. You can only have one key and value which may not give you all the info you want. The added functionality of managing the structure also apply an unnecessary burden that is rectified with a simple push and pop of a stack.
So, in summary:
 1) make a struct that holds the char, line, and column (suggested by Stefan Haustein)
 2) when you find your brace, push the struct with the relevant info
 3) if you reach EOF and stack is not empty, pop the rest of the stack and print the structs' info
    if you reach the end of the stack but still have a close bracket, print the info 

