C++ errors when compiling
<p>I'm getting the following errors when trying to compile and i just can't understand why, my apologies if it's something simplistic and easy to solve but i'm pretty new to c++ and having abit of trouble getting my head around it. </p>

<p>Errors:</p>

<pre><code>main.cpp|20|error: invalid conversion from 'char*' to 'char' [-fpermissive]|

msgpacket.h|15|error:   initializing argument 5 of 'MsgPacket::MsgPacket(int, int, int, int, char)' [-fpermissive]|
</code></pre>

<p>Files
main.cpp</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include "DataStream.h"
#include "MsgPacket.h"
using namespace std;
DataStream name;
DataStream * myPackets = new DataStream();
int main() {
int source;
int destination;
int type;
int port;
int input;
char data[50];
MsgPacket * Packet = new MsgPacket(source,destination,type,port,data);
cout &lt;&lt; "My Assignment" &lt;&lt; endl;;
}
</code></pre>

<p>MsgPacket.h</p>

<pre><code>#ifndef MSGPACKET_H
#define MSGPACKET_H
#include &lt;string&gt;
#include "PacketAddress.h"

using namespace std;

class MsgPacket : public PacketAddress {
public:

MsgPacket();
MsgPacket (const MsgPacket &amp; rhs);
MsgPacket(string dataIn);
MsgPacket(int port, int source, int destination, int type, char data);
string toString();
string getData() const {return _data;};
void setData(string inData) {_data = inData;};
string dataOutput();
virtual ~MsgPacket();
virtual MsgPacket * Clone() { return new MsgPacket(*this); }
protected:
string _data;
};
#endif // MSGPACKET_H
</code></pre>

<p>MsgPacket.cpp</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;iostream&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;iomanip&gt;
#include "msgpacket.h"
using namespace std;

MsgPacket::MsgPacket():
PacketAddress(0,0)
{

}

MsgPacket::MsgPacket (const MsgPacket &amp; rhs):
PacketAddress(rhs),
_data(rhs.getData())
{

}

MsgPacket::MsgPacket(string dataIn):
PacketAddress(0,0){
string temp;
temp = dataIn.substr (0,4);
_source = atoi(temp.c_str());
temp = dataIn.substr (5,4);
_dest = atoi(temp.c_str());
temp = dataIn.substr (10,4);
_type = atoi(temp.c_str());
temp = dataIn.substr (15,4);
_port = atoi(temp.c_str());
_data = dataIn.substr (20,dataIn.length());
#ifdef DEBUG
cout &lt;&lt; "CREATE PACKET: " &lt;&lt; this-&gt;toString() &lt;&lt; endl;
#endif
}

MsgPacket::MsgPacket(int source, int destination):
PacketAddress(source,destination)
{

}

MsgPacket::MsgPacket(int source, int destination, int port):
PacketAddress(source,destination)
{
_port = port;
}

MsgPacket::MsgPacket(int source, int destination, int type, int port, char data):
PacketAddress(source, destination)
{
_source = source;
_dest = destination;
_type = type;
_data = data;
_port = port;
}

MsgPacket::~MsgPacket()
{
//dtor
}

string MsgPacket::dataOutput()
{
stringstream output;//create a stringstream
output &lt;&lt; setw(4) &lt;&lt; setfill('0') &lt;&lt; _source &lt;&lt; ":" &lt;&lt;  setw(4) &lt;&lt; setfill('0') &lt;&lt; _dest &lt;&lt; ":" &lt;&lt; setw(4) &lt;&lt; setfill('0') &lt;&lt; _type &lt;&lt; ":" &lt;&lt; setw(4) &lt;&lt; setfill('0') &lt;&lt; _port &lt;&lt; ":" &lt;&lt; _data;
return output.str();
}

string MsgPacket::toString()
{
stringstream output;//create a stringstream
output &lt;&lt; "[" &lt;&lt; showbase &lt;&lt; hex &lt;&lt; this  &lt;&lt; "] S:[" &lt;&lt; _source &lt;&lt; "] D:[" &lt;&lt; _dest &lt;&lt; "] P:[" &lt;&lt; _type &lt;&lt; "] T:[" &lt;&lt; _port &lt;&lt; "]" &lt;&lt; " DATA[" &lt;&lt; _data &lt;&lt; "]";
return output.str();
}
</code></pre>
