Linked list and polynomials

hi there
how can i access different data type in a linked list?(say p has int char,double etc)
how can i add two polynomial using linked list(how do i keep track of the coeficent and the exponent)

thank you so much
Consider this code structure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
struct node {

int i; 
char c; 
double d; 
node *next; 
}; 

int main() {

node *head = NULL; 
head = new node; 
head->c = 'a'; 
head->d = 10.4; 
head->i = 12; 
head->next = NULL; 

return 0;
} 


Hope this helps !
Topic archived. No new replies allowed.