## C++ – Count the number of occurrences of a character in a string

Posted: 13th October 2013 by Tim in C++
Tags: , , , , , , ,

Counting the number of occurrences of a given character in a std::string can be done using one function from the STL library: the std::count(…) function. This function takes three parameters: two iterators (the beginning and end of the desired search), and the item you wish to count. This function can be used for any STL […]

## Incorrect referencing in LaTeX documents

Posted: 24th February 2010 by Tim in LaTeX
Tags: , , , , , , , ,

If you’ve written up a LaTeX document and find that some of the figures, tables, algorithms, etc. are being referenced wrong (such as Figure 2.4 being referenced as figure 6), chances are you’ve put your caption and \label tags in the wrong order. LaTeX needs \label to be after \caption, or for \label to be […]