is there any order which we should follow in including libraries and using namespace std.if yes why?if not why?
Order of including libraries and using namespace in c++
@Rj.25
hello Reechika,
I think order will not matter because compiler will replace all preprocessor directive with their declaration( not definition) .
example if ->
#include < sum>
#include < sub>
then preprocess replace them with
int sum(int a,int b); // declaration)
int sub(int a,int b) ; // declaration
order between them will not matter.
using namespace std; (u need to know about namespaces first)
here we are just saying that we want to use namespace std where cin and cout is present inside iostream file / library
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.