Hi guys after doing some research thought I had finally got my program to count html tags correctly. However its not working. When the program is run, it a weird amount for number of tags. The idea I tried was the following
Perhaps if you showed the entire program it would help. Can there be more than one tag, or trick input? In that case, if a tag is any "<" followed by a ">" it seems your boolean might look more like:
1 2
while ( str.find("<") < string::npos && str.find(">") > str.find("<"))
{ amounttag++; //then if >1 tags per str, str.assign(...remainder, if any, of str after first ">"...)