Hi
Why is that wrong
#include<iostream>
#include<conio.h>
using namespace std;
struct Node
{
char your_name;
Node *link;
};
typedef Node* NodePtr;
class Q
{
public:
Q();
void get_input( );
void display_input( );
private:
NodePtr head;
};
int main()
{
Q name;
char your_name;
cout<<"What is your name: ";
name.get_input( );
name.display_input( );
getch();
return 0;
}
Q::Q()
{
cout<<"Your name is initialize to '/0'"<<endl;
head=NULL;
}
void Q::get_input( )
{
char temp[50];
cin>>temp;
head= new Node;
strcpy(head->your_name,temp);
head->link=NULL;
}
void Q::display_input( )
{
cout<<"Your name is equall to: ";
cout<<head->your_name;
}
tghe error I have is :
46 C:\Documents and Settings\mauro\Desktop\c++\nodes- another simple example using an array of characters.cpp invalid conversion from `char' to `char*'
thx