I'm quite confused about what happens here.
while ( (ent = readdir(dir)) != NULL)
{
char *name = ent -> d_name;
....
}
This is just some basic code for scanning a directory. Fair enough. But I can't understand how this compiles, because how in the name of... can the compiler determine the size of ent -> d_name? No one knows it at compile time, and memory MUST be allocated for that, am I right? Is the compiler automatically malloc()ing this for me or what? I'm using GCC under Ubuntu if that's relevant.
Thanks in advance.