You are not logged in.
This might not be a direct GRRLIB question and I am extremely new to C programming - been using Java and C# all so far. But here goes.
If i want to fill a vector (its important that it is not an array since i have a variable size) with images or a struct that defines informations about a image/shape..
Fx.
typedef struct { int number; GRRLIB_texImg *shape; int x_coord; int y_coord; int angle; } shape;
How do i do this? What is the syntax for using vectors? Do i need to include something or?
I found out that if i want a array of shapes i can do the following
shape shapes[100];
But now i have an upperlimit. That is not my how i want it because this upperlimit can easily be out of bounced by the user placing more than 100 shapes.
Many thx in advance.
Offline
Hi, look at the GRRLIB_LoadBMF function at the place where I allocate the numbers of GRRLIB_bytemapChar dynamically:
fontArray->charDef = (GRRLIB_bytemapChar *)calloc(fontArray->nbChar, sizeof(GRRLIB_bytemapChar));
Offline
Check malloc, realloc, calloc and free on this Web site: http://msdn.microsoft.com/en-us/library/hk1k7x6x.aspx
Offline
If you want to program in C++, then you could use std::vector. There is a demo at http://code.google.com/p/grrlib/source/ … e/main.cpp
Offline