D
David Buck
If I have a structure as follows;
typedef struct {
double x;
double y;
int size;
char text[256];
} text;
I have allocated a space of 256 bytes for some text entered. If the text is
less than 256 bytes, what happens to the rest of them.
I am interested as I want to append other objects after the text in memory,
and if the user only enters a few bytes, I only want to use that amount of
data (rounded to the next word);
if C automatically either writes the remaining bytes to a specific value, or
currupts them, I will have to do this another way.
typedef struct {
double x;
double y;
int size;
char text[256];
} text;
I have allocated a space of 256 bytes for some text entered. If the text is
less than 256 bytes, what happens to the rest of them.
I am interested as I want to append other objects after the text in memory,
and if the user only enters a few bytes, I only want to use that amount of
data (rounded to the next word);
if C automatically either writes the remaining bytes to a specific value, or
currupts them, I will have to do this another way.