Bsc III Computer Science Subjects
C++ topics PPts and audios
#include <iostream>using namespace std;
namespace A {
int num = 10;
}
namespace B {
int num = 20;
}
int main() {
cout << A::num << endl; // 10
cout << B::num << endl; // 20
return 0;
}
Output:
A::num → Namespace A ke andar ka num
B::num → Namespace B ke andar ka num
C++ Standard Library ke saare functions
std naam ke namespace me hote hain. har jagah std:: likhna nahi padega:Example:-
using namespace std;
std::cout << "Hello";
std::string s = "Hi";
No comments:
Post a Comment