PDA

View Full Version : Generic Program


haow85
09-04-2010, 10:50 AM
If I would like to sort an array of elements input by the user, but without the knowledge of the type of elements beforehand. What am I supposed to do? Thanks.

BrickInTheWall
09-04-2010, 05:17 PM
What language are you using? In an object oriented language like C# for example you could just store everything in an array/list of type Object, and then use runtime type checking when going through the list.

haow85
09-04-2010, 11:47 PM
What language are you using? In an object oriented language like C# for example you could just store everything in an array/list of type Object, and then use runtime type checking when going through the list.
I am talking about C++.