Hi to all,
I am sorry if the question is off topic.
But I am trying to learn c++ and in the following code I am getting two
errors using TurboC++ compiler 3.0
Error D:\1.cpp 17 structure reqired on left of . or .*
Error D:\1.cpp 18 list::node::data is not accessible.
/********code***********/
#include<iostream.h>
class list
{
private :
class node
{
int data;
node *link;
}*p;
public :
void create()
{
p=new node;
p.data=10;
p->data=10;
}
};
int main()
{
list l1;
l1.create();
return 0;
}
Could anybody please tell me why these errors are there and how to
remove.
With Regards
James