I just downloaded Borland C++ version 6 because my old compiler was giving alot of problems. I made this programme just to test the compiler and it giving declaration syntax error. Please help !
#icnlude <iostream>
#using namespace std; //this will help to recognize cout in the statement.
int main ()
{
cout << "This is it.";
return 0;
}
two statements:
std::cout
using namespace std;
perform same task, as in
If you have seen C++ code before, you may have seen cout being used instead of std::cout. Both name the same object: the first one uses its unqualified name (cout), while the second qualifies it directly within the namespace std (as std::cout).
cout is part of the standard library, and all the elements in the standard C++ library are declared within what is a called a namespace: the namespace std.
In order to refer to the elements in the std namespace a program shall either qualify each and every use of elements of the library (as we have done by prefixing cout with std::), or introduce visibility of its components. The most typical way to introduce visibility of these components is by means of using declarations:
using namespace std;
The above declaration allows all elements in the std namespace to be accessed in an unqualified manner (without the std:: prefix).
All compilers with the word "Borland" in the name are ancient, pre-standard programs. Download a modern compiler. See this for useful links. http://www.cplusplus.com/articles/j8hv0pDG/
I recommend you look at the IDE options, like Code::Blocks.