I Have been Searching the Internet For A while Now And could Not Find A Good Answer.
My Question Is Can We Make A Link List Of Which`s node Only Contains One Data Element e.g int float etc etc.... but the link list can contain different node types.... like this where [] is one node
Can you rephrase the question? I don't get what you are trying to do here.
Anyway expressions like int=12 or float=45.6 and char='c' are not valid in C++. They are types and probable you need variables of these types assigned those values.
void valuesetter()
{
cout<<" Enter Data the type of Data You Want To Enter "<<endl;
cout<<" 1.Int 2.Float 3.Char : ";
int input;
cin>>input;
cout<<endl;
if(input==1)
{
cout<<" Enter The Data You Want To Put ";
cin>>input;
i=new int;
*i=input;
}
if(input==2)
{
double a;
cout<<" Enter The Data You Want To Put ";
cin>>a;
f=new double;
*f=a;
}
if(input==3)
{
char a;
cout<<" Enter The Data You Want To Put ";
cin>>a;
c=new char;
*c=a;
}
}