+ 1

Turbo C++ doesn't support namespace?

I have Turbo C++ on my laptop, but writing "using namespace std;" gives me an error saying "error in declaration syntax", on compilation How can it be wrong??

18th Oct 2018, 8:31 AM
Vedant Bang
Vedant Bang - avatar
8 odpowiedzi
18th Oct 2018, 8:54 AM
Harsh
Harsh - avatar
+ 2
recently does not mean few years back , check this https://en.cppreference.com/w/cpp/language/history
18th Oct 2018, 8:54 AM
onekpsc
0
Turbo c++ is getting old , use Codeblocks IDE
18th Oct 2018, 8:35 AM
onekpsc
0
Ok so the syntax "using" has been introduced recently?
18th Oct 2018, 8:36 AM
Vedant Bang
Vedant Bang - avatar
0
yes
18th Oct 2018, 8:40 AM
onekpsc
0
Bad practice : include <iostream> using namespace std; void main(){ cout << "welcome to sololearn" << endl; } Good practice: include<iostream> void main(){ std::cout << "welcome to sololearn" << std::endl; } ofcourse both produce same result , you will understand later why am i telling you not to use namespace
18th Oct 2018, 8:46 AM
onekpsc
0
ahh I see, too old
18th Oct 2018, 11:01 AM
Vedant Bang
Vedant Bang - avatar
0
yes turbo c++ doesn't support namespace because it's compiler is different use codeblock for writing code in c++
18th Oct 2018, 5:27 PM
harsh