Difficulty in compiling CPP codes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Difficulty in compiling CPP codes

well I have been coding on my PC itself till now.. then I got this app.. the code which runs perfectly on turbo c++ doesn't run here and shows error from using header files to basic streams like cin and cout it's quite frustrating... can someone please sort out the reason behind this anomaly?😓

26th Sep 2017, 11:06 PM
Debottam Mazumder
Debottam Mazumder - avatar
5 Answers
+ 2
ah. you do not need to specify the headers extension here; just the header name. for the namespace: the directive using namespace std tells the compiler that you do not wish to type out the library from which you are pulling from every time (so you can type cout << "whatever"; instead of std::cout << "whatever"; ) with that being said, if you do not wish to use namespaces, you can remove it and specify each command from each library.
26th Sep 2017, 11:25 PM
Frédéric Charette
Frédéric Charette - avatar
+ 2
Honestly, I haven't used turbo C++ in so long, I'm not sure of that syntax anymore, I would have to lookup my old references, but I believe that may be a C++ 11 directive more than GCC compiler specific (but could be wrong.)
27th Sep 2017, 11:40 AM
Frédéric Charette
Frédéric Charette - avatar
+ 1
Which code are you trying to run?
26th Sep 2017, 11:14 PM
Frédéric Charette
Frédéric Charette - avatar
0
any simple code... I was actually testing the app so I just wrote a code to add two numbers... but the iostream.h is not allowed only iostream is allowed and there is something "using namespace std" whose purpose i didn't understand
26th Sep 2017, 11:17 PM
Debottam Mazumder
Debottam Mazumder - avatar
0
thanks for your answers😊 1 last thing not using a #hashtag in front of "using" is it another property of GCC compiler? I mean to say if we had to write "using namespace std" in turbo c++ then we had to use a hashtag before the "using" preprocessor directive isn't it?😅🤔
27th Sep 2017, 8:04 AM
Debottam Mazumder
Debottam Mazumder - avatar