0

Hi,

How to do arithmetic and relational operations using Standard Template Library.(STLs).
Could any one please guide me regarding this. I am new to Standard Template Library.

3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by mitrmkar
0

why we have to use following code in STL programs. why it is needed.

use namespace std;
0

why it is needed.

It's not.

You're just telling the compiler that you want to use all commands from the std namespace. If you're only planning to use the command 'cout' from std-namespace, you could write: using std::cout; ór you could put the std:: in front of the command you're using from the std-namespace:

std::string str = "something";
std::cout << str << std::endl;

Now there's no need to say: using namespace std

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.