Wow... This is awesome! I'm learning tons too. OK, I have one more question regarding all this.
So, within a function I read from a local config file (2 lines), and return that array. So, within the function, all values are there, but they come out all funky after returned. Here's my code:
CODE
char* getConfig()
{
debug("Opening Config file");
FILE *fp;
if((fp = fopen("D:\\xblock.xml","r")) != NULL)
{
char *conf[2] = {NULL};
char line[100];
int i = 0;
//loop through lines
while (!feof(fp)){
fgets(line, 50, fp);
debug(line);
conf = line;
i++;
}
fclose(fp);
return *conf;
}
else
{
return "";
}
}
Then when calling this function:
CODE
char *conf[2] = {NULL};
*conf = getConfig();
But it returns stupid stuff like:
ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ
Please feel free to tell me how horribly written any of that is. Thanks again for all the teaching!
NOTE: debug() function is just a simple function that writes stuff to a file since I can't get my debugging to work.