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.

Here's a link for STL with example codes

just scroll down for arithmetic and relational operations.

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

use namespace std;

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

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

use namespace std;

It is not obligatory, but if you omit it, then you have to explicitly specify the namespace whenever you access/use something within a namespace e.g. [B]std[/B]::string mystring = "test"; .

see
http://www.cplusplus.com/doc/tutorial/namespaces.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.