0

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.

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by onus
0

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);
}

Edited by gerard4143: n/a

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.