HTML parsing algorithm for extracting  tags My intention is to create a complete HTML parser, so far I made a basic algorithm that iterates trough text and extracts everything in an "a" tag.

It works on everything I tried, but I want a review of what I could do better or what I did right.

#include &lt;iostream&gt;
#include &lt;stdio.h&gt;
#include &lt;vector&gt;
#include &lt;fstream&gt;
#include &lt;streambuf&gt;
#include &lt;sstream&gt;


std::vector&lt;std::string&gt; performCheck(std::string check, std::string text)
{       
        int iterator = 0;
        int second_iterator = 0;

        bool is_flag = false;

        std::string returnString = "";
        std::vector&lt;std::string&gt; returnVector;

        for(iterator = 0;iterator &lt; text.size();iterator++)
        {
            if(text[iterator] == '&lt;')
            {

                is_flag = true;

                for(second_iterator = 0;second_iterator &lt; check.size();second_iterator++)
                {
                    if(text[iterator + second_iterator] == check[second_iterator])
                    {   
                        returnString = returnString + text[iterator + second_iterator];
                    }
                    else
                    {
                        is_flag = false;
                        returnString = "";
                        break;
                    }
                }

                if(is_flag == true)
                {
                    for(second_iterator = iterator + second_iterator;second_iterator &lt; text.size();second_iterator++)
                    {   
                        returnString = returnString +  text[second_iterator];

                        if(text[second_iterator - 2] == '/' &amp;&amp; text[second_iterator - 1] == 'a')
                        {   
                            returnVector.push_back(returnString);
                            break;
                        }
                    }   
                }

            }

        }

    return returnVector;    
}


int main(int argc, char** argv) {

    std::string check = "&lt;a href=\"";
    std::vector&lt;std::string&gt; urlmap;

    std::ifstream t("your_file.ext");
    std::stringstream buffer;
    buffer &lt;&lt; t.rdbuf();

    std::string textBig = buffer.str();


    urlmap = performCheck(check, textBig);

    for(int iterator = 0;iterator &lt; urlmap.size();iterator++)
    {
        std::cout&lt;&lt;urlmap[iterator]&lt;&lt;std::endl;
    } 

    system("PAUSE");

    return 0;
}
First of all, as Loki mentioned in the comments, it is incredibly cumbersome to parse any text that made by human. We tend to abuse things, so I'd refrain from parsing it myself. There are good libraries that does parsing. If you want performance, I'd go with boost.spirit that is based on expression templates. I've also made a topic request about expression templates on so.docs, but it still has low upvote count, so don't rely on it to come in near future. I strongly encourage you to read about both, because it is the greatest power to have in parsing input files.
About the code:
Good try, but probably you will need a lot more. Some people would think that I need to put suggestion about regex over hand rolled search, but I will just put
link to an article on very famous blog.
Use &lt;cstdio&gt; instead of &lt;stdio.h&gt;. All C headers have C++ equivalents and are preferred over C ones.
Don't mix &lt;cstdio&gt; and &lt;iostream&gt;. The I/O may become unordered.
Overflow:
int can and will overflow. For example here:
iterator + second_iterator

The C standard guarantees only 16 bit for it as I remember. It is not mandated by the standard that return type of the std::string::size() is int. In fact it will probably never be int, because it is signed type, but size can not be negative. I recommend you to use std::string::size_type. It is guaranteed by the standard that this type will have enough capacity to store the maximum possible index that std::string can have.
Readability comments:
second_iterator - 2
second_iterator - 1

Those 2 expressions rise alerts in my head, because type of second_iterator is int, which is signed. I know that it will never be less than 2 by design, but I think that there is at least one better solution, one of which is mentioned above.
I'd wait bool(s) from any function that has check word in it's name. I think the function now performs what sequence of std::string::find()s does. This suggests using standard one. It will be much more clear.
Performance comments:
Usually standard containers are implemented in terms of 3 pointers, not a pointer and 2 indices. This suggests that iterator based algorithms will outperform index based ones. Further reading.
I found it impractical using push_back() without preceding reserve() call where performance matters. On top of that, every push will have control flow manipulators, which will greatly decrease the throughput on the function.
I'd use std::string::compare to compare check string and the substring. The implementations are allowed to deploy more intelligent comparison functions, so it might have zero development cost optimization.
Redesign:
I'd redesign the function to accept Input Iterators. It will make it more customizable with zero runtime overhead (well it depends on the iterator, but it is possible and easy to do). It will also keep strings from being copied.
Notes about example code:
You can use range for loop to traverse whole container/range.
Declaring urlmap right on assignment would trigger copy elision (the output will start constructing right in urlmap).
Don't use system(). It is the source of many security issues.