GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 01-Dec-2004, 00:35
Quesius Quesius is offline
New Member
 
Join Date: Dec 2004
Posts: 1
Quesius is on a distinguished road

newbie needs help with vectors


Basically, I am trying to define a data type that is a vector of vectors. My attempt at it looks something like this:

CPP / C++ / C Code:
typedef GLfloat GLTPoint[3];

struct BlockedSolid
{
	GLTPoint3 lower_left_back;
	GLTPoint3 upper_right_frot;
};

struct BlockedSolidGroup
{
	vector<BlockedSolid> blocked_solids; 
	GLint lowest_starting_x;
};

struct TotalBlockedSpace
{
	vector<BlockedSolidGroup> all_blocked_space;
	GLint group_size;//range of x-values covered by each BlockedSolidGroup
	GLint max_length;//longest (x-length) allowed for a BlockedSolid
};



boolean CheckCoordinateBlocked(GLTVector3 test_point, TotalBlockedSpace blocked_space)
{
	GLint solid_group;
	GLint solid_group_size;
	GLint i;

	solid_group = test_point[0] / blocked_space.group_size;//find correct zone to search
	solid_group_size = blocked_space.all_blocked_space[solid_group].size();//determine size of zone to be searched
...snip
}


Please note that GLint, GLfloat, etc. are just ints and floats that are used by OpenGL. and should be interchangable with int and float for this code sniplet.
Anyway, when I try to complie this, I get an error on my last listed line saying that 'size' is not a member of 'BlockedSolidGroup.' But if I understand my code correctly, blocked_space.all_blocked_space[solid_group] should refer to a vector and should be able to be sized.
So obviously I am missing something here.
Thanks for any assiatance.

Curtis
Last edited by dsmith : 01-Dec-2004 at 07:28. Reason: Please use [c] & [/c] for syntax highlighting
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ Vectors Katie C++ Forum 5 18-May-2004 00:36
linked lists, newbie needs help moltarim C Programming Language 4 06-May-2004 12:32
Declaring a vector of vectors? Lethal411 C++ Forum 2 20-Mar-2004 10:02
newbie using Sam's series Skampy C++ Forum 3 06-Mar-2004 19:51

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:00.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.