Shyam Prasanna
Shyam Prasanna

Reputation: 111

Implementation files

Where can I find the source code of a library file?. I am new to C++ , and I am very much eager to see the implementation file for a library file?

#include<iostream>
#include<list>
#include<iterator>
using namespace std;

int main(void)
{
    list <int> a;
    list<int> :: iterator it;
    a.push_back(2);
    a.push_front(1);
    a.push_back(3);
    for(it=a.begin();it!=a.end();it++)
    {
        cout<<*it;
    } 
    //prints 123
    return 0;
}

In this code, I want to know the implementation of push_back() and push_front(). Where can I find it?

Upvotes: 0

Views: 155

Answers (1)

Caleb
Caleb

Reputation: 125007

Where can I find the source code of a library file?. I am new to C++ , and I am very much eager to see the implementation file for a library file?

That depends entirely on the library. There are open source implementations of the standard libraries, so you can do a search for something like iostream source code. You might also want to check with the supplier of whatever compiler and development system you're using. But some libraries, e.g. those that you license from a vendor, may not make their source code available at all.

Upvotes: 2

Related Questions