this is my program i am getting a error while compiling it can someone help me...
error is
----- Build started: Project: paddy, Configuration: Debug Win32 ------
Compiling...
manager.cpp
c:\documents and settings\others\my documents\visual studio 2005\projects\paddy\paddy\manager.cpp(51) : error C2664: 'Pensioner::Pensioner(char *,char *,char *,long,char *)' : cannot convert parameter 1 from 'std::string' to 'char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
c:\documents and settings\others\my documents\visual studio 2005\projects\paddy\paddy\manager.cpp(54) : error C2664: 'Customer::Customer(char *,char *,char *,long)' : cannot convert parameter 1 from 'std::string' to 'char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Build log was saved at "file://c:\Documents and Settings\others\My Documents\Visual Studio 2005\Projects\paddy\paddy\Debug\BuildLog.htm"
paddy - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
the program is..
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include "Customer.h"
#include "Pensioner.h"
using namespace std;
class Manager
{
private:
void readFile(char const* filename)
{
ifstream input(filename);
if (!input)
{
cout << "Error in Opening the file.\n";
return;
}
string line;
while (getline(input, line))
{
istringstream oss(line);
char cmd;
oss >> cmd;
switch (cmd)
{
case 'A' : {
if (size == MAX_CUSTOMERS)
{
cout << "The store is empty\n";
return;
}
string first, last, phone;
int Nofcalls;
oss >> first >> last >> phone >> Nofcalls;
oss >> cmd;
if (cmd == 'P')
{
string pension;
oss >> pension;
customers[size++] = new Pensioner(first, last, phone, Nofcalls, pension);
}
else
customers[size++] = new Customer(first, last, phone, Nofcalls);
break;
}
case 'D' : {
if (size == 0)
{
cout << "The store is empty\n";
return;
}
delete customers[--size];
break;
}
case 'O' : {
ofstream output("CustomerOutput.dat", ios_base::out | ios_base::app);
for (int i = 0; i < size; ++i)
output << *customers[i] << "\n\n";
break;
}
default : cout << "Invalid directive\n";
return;
}
}
}
public:
Manager()
: size(0)
{
}
~Manager()
{
for (int i = 0; i < size; ++i)
delete customers[i];
}
void run()
{
readFile("telephone.dat");
}
enum {MAX_CUSTOMERS = 100};
int size;
Customer* customers[MAX_CUSTOMERS];
};
int main()
{
Manager manager;
manager.run();
return 0;
}