Read arguments from a config file in C

Hello everybody,
I'm coding a program in C and i'm getting troubles with this.

I need to read a config file and store the arguments into individual variables, let's say the config file looks like the following:

#This is the configuration file...
192.168.0.1      A1:B1:C1:D1:E1:F1
192.168.0.2      A2:B2:C2:D2:E2:F2
192.168.0.3      A3:B3:C3:D3:E3:F3
#End of Configuration file.

So, what i need is to read the first line, and store the first IP address ("192.168.0.1") into a variable, and "A1:B1:C1:D1:E1:F1" into another, use the stored data, and then, read the next line and do the same.

Also, i have to skip the lines starting with "#" to allow comments on the config file.

Any help will be appreciated,
Thanks.

char line[256];
int linenum=0;
while(fgets(line, 256, file) != NULL)
{
        char ip[256], mac[256];

        linenum++;
        if(line[0] == '#') continue;

        if(sscanf(line, "%s %s", ip, mac) != 2)
        {
                fprintf(stderr, "Syntax error, line %d\n", linenum);
                continue;
        }

        printf("Line %d:  IP %s MAC %s\n", linenum, ip, mac);
}

Man, you're a great programmer. Thanks!:b: