Vector troubles

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: Vector troubles

Post by LuisR14 » July 8th, 2013, 4:28 am

LuX wrote:Vector is really a template class itself so there are some restrictions as to what you can do with it.
and actually because it's a template class you can use any type that has been defined, so pretty much he could've used the way he had it

Code: Select all

std::vector<Menu&> LMenu;
it was just a matter of not using it right :P
since probably then he was trying to do something like the pointer code i posted above for the CreateButton function
(well guessing there since he hadn't posted that part of the code before his penultimate post :P)

correct way to use would've been

Code: Select all

virtual void CreateButton( unsigned int X, unsigned int Y, unsigned int Length, unsigned int Height, Menu menu );

Code: Select all

	MainMenu.CreateButton( 0, 0, 100, 50, DXHV );
	ToMainMenu.CreateButton( 0, 742, 25, 25, MainMenu );
edit: man, edit post page sure doesn't have the quote feature x(P
Last edited by LuisR14 on July 8th, 2013, 5:58 am, edited 1 time in total.
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Vector troubles

Post by cameron » July 8th, 2013, 4:53 am

Thanks for the info. :D
Computer too slow? Consider running a VM on your toaster.

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: Vector troubles

Post by cameron » July 8th, 2013, 8:19 pm

I am having more vector troubles ugh. Are there any other cases for vector subscript out of range besides trying to access an index that doesn't exist? I have done hours of debugging and cant see why I am getting this error. I will upload proj if it is necessary.
Computer too slow? Consider running a VM on your toaster.

Post Reply