Administrator
Administrator
Posts: 3307
Joined: Thu Dec 24, 2009 2:06 am
Allegiance:: Space Rome
Location: ON, Canada
User avatar
Administrator
Administrator
Re: C++/C programming discussion

Post by Scott »

Matthew wrote:I may look later as I'm on my iPhone at the moment. What is T?
It's a template typename. It is whatever the user of class defines it as. It can be <int>, <char>, <bool>, ect.
Image
Jedi Master
Jedi Master
Posts: 336
Joined: Sun Aug 09, 2009 9:16 am
Allegiance:: Jedi
User avatar
Jedi Master
Jedi Master
Re: C++/C programming discussion

Post by Matthew »

Don't you need to delete the contents before add_on is called?

"GREAT.len() > 1 || LESS.len() > 1"

I don't think those will ever get smaller if they are only supposed to be sorted. You should do a tet at the beginning of the function to see if the list is more then one element or not.
Administrator
Administrator
Posts: 3307
Joined: Thu Dec 24, 2009 2:06 am
Allegiance:: Space Rome
Location: ON, Canada
User avatar
Administrator
Administrator
Re: C++/C programming discussion

Post by Scott »

Matthew wrote:Don't you need to delete the contents before add_on is called?
Delete what particular contents? You don't have to do anything except call add_on.
Matthew wrote:"GREAT.len() > 1 || LESS.len() > 1"

I don't think those will ever get smaller if they are only supposed to be sorted. You should do a tet at the beginning of the function to see if the list is more then one element or not.
I may do some small scale recursion tests so I can understand it better.

EDIT:

Attempting to get strings working with chamber is hard, and really, useless :8(:
Image
Post Reply