The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
Well, first of all I would recommend making a full blown LinkedList class instead of doing it c style with pointers, because managed c++ was made to be more object oriented than c++.
That said, your addFront function's signature should look something like
node addFront(node);
main(...){
if (choice == 1){addFront(start);}
}
node addFront(node^start){}
Error 1 error C2664: 'addFront' : cannot convert parameter 1 from 'node ^' to 'node'
Variations of start in main yield similar results.
You're getting that error because you're declaring that addFront takes a 'node' not a 'node ^'. A 'node' and 'node ^' are different types, just like 'int' and 'int *' are different types.
Edit: So you're second definition of addFront is an overload, not the definition of the one you declared above main, because the parameter types differ.
Posts
That would be good advice as well.
Variations of start in main yield similar results.
That said, your addFront function's signature should look something like
You're getting that error because you're declaring that addFront takes a 'node' not a 'node ^'. A 'node' and 'node ^' are different types, just like 'int' and 'int *' are different types.
Edit: So you're second definition of addFront is an overload, not the definition of the one you declared above main, because the parameter types differ.