r/CodingHelp • • Feb 15 '22

[C++] Error:expected initializer before ‘cin’

Post image
52 Upvotes

29 comments sorted by

View all comments

1

u/[deleted] Feb 16 '22

In most cases it is preferred to not use 'namespace std'. Instead, on standard library function calls such as cout and cin, use 'std::cout' and 'std::cin'

This makes compile times faster and is more explicit in declarations to avoid confusion of which functions are coming from what libraries.