Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a lib

Status
Not open for further replies.

KingOfJava

Programmer
Feb 21, 2003
7
US
//Example.cpp

// MAIN FILE : It make use of Test.h and Test.cpp

#include "Test.h"

int main(){
Test *t = new Test("KingOfJava");
cout << t->getMessage() << endl;
}

//++++++++++++++++++++++++++++++++++++++++

//Test.h

#include <iostream>
#include <string>
using namespace std;

class Test{

string msg;

public:

Test(string s);

string getMessage();


};

//++++++++++++++++++++++++++++++++++++++++

// Test.CPP

#include &quot;Test.h&quot;

Test::Test(string s){
msg = s;
}
string Test::getMessage(){
return msg;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++

I am new to CPP and I wanted to creat an example of Lib file.

I have created a header file I wanted to put it in Include directory of Borland comp

Test.cpp I wanted to creat an object file out of it. And wanted to put it in Lib directory.

And I wanted to write an example program which make use of them.

Please help how to do them.

Thanx in advance,

Regards,

Samule.
 
Create a new project of the type &quot;Win32-library&quot; or something like that (I don't know exact translation to english).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top