So I want to have a buffer with an array of structs like this:
EventItem
{
tag; // some string or array of characters to describe the value;
value; // some integer or something
}
The value can be anything like int32. What I am concerned about is the tag. If I have an array of these objects, and I make the tag a string, what happens if the user inputs an EventItem into this buffer that has a long tag? Will that cause the buffer or parts of it to be copied to somewhere else in memory to hold this bigger EventItem (bigger because of this long string)?
Would it be better for me to limit the tag by just using a fixed amount of character by using an array instead of a string?
Obviously I don't know exactly what I'm talking about, but I don't know how the buffer can be created with the right amount of contiguous space without knowing the size of the EventItems in advance.
Could someone explain how this situation would go down for me?
Thanks very much in advance!