+ 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?😓
6 ответов
+ 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.
+ 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.)
+ 1
Which code are you trying to run?
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
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?😅🤔