You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
423 B

#include<stdio.h>
#include<stdlib.h>
#include"read_cfg.h"
int main(){
char file[]="test.cfg";
options *option;
option=read_cfg(file); //returns pointer to struct with options
printf(option[1].name);printf("\n");
printf(option[1].setting);printf("\n");
printf(option[2].name);printf("\n");
printf(option[2].setting);printf("\n");
free(option); //freeing memory that got alloced in the function read_cfg
return 0;
}