I am studying C++ from this site and I havent studied arrays, STL, vector and all that stuff . Obviously I visited that link but it was of no use for me .
In this syntax
// range-based for loop
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string str {"Hello!"};
for (char c : str)
{
std::cout << "[" << c << "]";
}
std::cout << '\n';
} WHY IS STD::COUT USED WHEN USING NAMESPACE STD DECLARATION IS ALREADY MENTIONED BEFORE INT MAIN ? ()
It wouldn't be necessary. Maybe the person writing that section is accustomed to using the std:: prefix where necessary instead of pulling the whole standard namespace into programs?