top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How does C compiler knows the keyword namespace?

+1 vote
414 views
How does C compiler knows the keyword namespace?
posted May 7, 2016 by Ashish

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

For most of the new C compilers namespace is a keyword but for the oldies like turbo C it is not. I would suggest in place of
namespace as using namespace std; use std:string.

Hope this helps, please comment if looking something different.

answer May 9, 2016 by Salil Agrawal
Similar Questions
+2 votes

Below is the sample code, Where size of a is not defined at the time of compilation,
Then how compiler knows the size of a? If we run the same program in C then compilation will fail.

#include<iostream>
using namespace std;
main()
{
        string a;
        cin>>a;
        cout<<a;
}
...