No allocation from the heap happens. Those string literals you're using, "ABC" and "DEF" are placed in some permanent part of the program, probably where you aren't allowed to write (so, e.g., don't use strcpy if name points to one of those strings). You got garbage when using name[3] because there are actually 4 characters in the string (remember the null terminator).
You're not quite proper on your initialization, you need an extra set of braces:
Code:
JustAStruct justastruct[4] =
{
{"ABC", 1234},
{"DEF", 5678},
...
};
Also I know this is just an example, but it's considered poor practice to have two things with the same name, and only different cases.