On this link
http://lxr.free-electrons.com/source/drivers/parport/parport_pc.c?v=2.6.29#L97
they defined a structure superio_struct and initialized as

superios[NR_SUPERIOS] = { {0,},};

I am not able to understand above initialization has what is it getting initialized to.

What I deduce till now is superios is a structure array of struct superio_struct
and NR_SUPERIOS is defined as 3 hence an array of structure of size 3
but

superios[0]=??
superios[1]=??
superios[2]=??

This part is not clear to me as to what these individual members are initialized to.

Recommended Answers

All 2 Replies

I know this is probably radical but why don't you write some code, like below, and try it yourself.

#include <stdio.h>
#include <stdlib.h>

struct mystr
{
	unsigned int a;
	unsigned int b;
	unsigned int c;
}thestr[3] = {{0,},};

int main(int argc, char**argv)
{
	int i;

	for (i = 0; i < 3; ++i)
	{
		fprintf(stdout, "a->%u\n", thestr[i].a);
		fprintf(stdout, "b->%u\n", thestr[i].b);
		fprintf(stdout, "c->%u\n", thestr[i].c);
	} 	
	exit(EXIT_SUCCESS);
}

I am not clear with the comma why is comma used there

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.