The error is telling you that std::cout
hasn't yet been declared anywhere in this translation unit. You can't use something if it hasn't been declared. std::cout
is declared in the C++ standard library <iostream>
header:
#include <iostream>
If you receive a similar error in the future and you need to know which header to include, look up some documentation for the particular function/type you want to use. For example, if you look at cppreference.com, it states "Defined in header <iostream>
".