I notice when reading examples of code that some people use cout and some use prinf. But what is the real difference, and is there any advantage of using one over the other?
std::cout is a global variable of type "output stream", declared in <iostream>, it is a part of the C++ I/O library.
std::printf is a function declared in <cstdio> it is a part of the C I/O library (which is included in C++)
C++ streams are versatile, customizable, and extensible. They are also rather complicated, few people care to learn them well.
C streams are very limited in what they can do and in what can be changed about them, and they are notoriously type-unsafe. Surprisingly few people care to learn them well either, but their basics are common knowledge because C has been around longer.
In a code example you may read on the web, if something can be done using either library, it doesn't really matter.