C++ implementation of Tic-Tac-Toe game
Check your inputs in enter()

You don't check that the user entered a valid vector index. For example, if I enter a 3 as the row and/or column number the program crashes. You should reject an input if the user enters an invalid row and/or column number (like you do if the user selects a space that is already taken).

All control paths of check() should return a value

You only ever return true in check(). If none of the check conditions are true then you should explicitly return false at the end of the function.

Use the correct type for indexing

You have for loops like for (int i = 0; i &lt; vec.size(); i++), which compare the signed integer i to the unsigned integer vec.size(). Use std::vector&lt; std::vector&lt;char&gt; &gt;::size_type.

Use a type alias / type definition for the std::vector&lt; std::vector&lt;char&gt; &gt; container

Use a type alias like using container = std::vector&lt; std::vector&lt;char&gt; &gt;; if your compiler supports it, otherwise use a type definition like typedef std::vector&lt; std::vector&lt;char&gt; &gt; container;. You can put it after the #include statements so you can use it for all your functions. This is useful for a couple of reasons:


It's a shorter name for the container. This comes in handy when referring to the container and/or its size_type, for example: container::size_type is shorter and easier to read than std::vector&lt; std::vector&lt;char&gt; &gt;::size_type.
It's easier to change the container. You may decide later to use a std::array instead, in which case you only need to modify the using statement rather than all instances of std::vector&lt; std::vector&lt;char&gt; &gt;.