Cout error. same code as ivan

Hi im getting an error:
C:\HelloWorld\k\main.cpp|18|error: no match for ‘operator>>’ (operand types are ‘std::ostream {aka std::basic_ostream}’ and ‘const char [25]’)||

for this code
cout >> "the name of the person: " >> p.name >>endl;

a simple cout doesnt work. do you know why?
thanks

when i copy paste the original line from the built in “hello world” cout it works. when i try to write myself a cout line it gives me an error.
help please

It’s a simple syntax error. Think of the direction of your less than or greater than signs indicating where the data is going. For cout you want to put things into cout so you should write less than signs << also known as the insertion operator. You want to pull things out of cin so you use the greater than signs >> also known as the extraction operator.

http://www.cplusplus.com/doc/tutorial/basic_io/

Hi, thank you for the reply.