Hello,
gcc 4.4.4 c89
Pointers are not the same as arrays. But arrays can decay into pointers.
I was just using memset which first parameter is a pointer. I would like to initialize my structure array.
i.e.
struct devices
{
char name[STRING_SIZE];
size_t profile;
char catagory;
};
struct devices dev[NUM_DEVICES];
memset(dev, 0, (size_t)NUM_DEVICES * sizeof(*dev));
dev == &dev[0]
But should I pass the first parameter has this:
memset(&dev, 0, (size_t)NUM_DEVICES * sizeof(*dev));
Many thanks for any advice,