Try the following function. If your parameter values in the file do not come immediately after the equal sign, you may want to add some code to pass the space characters.
char Status[10];
char Path[255];
void ReadPar()
{
FILE *in;
char ch;
if((in=fopen("Info.txt","r")!=NULL)
{
//read characters until encounter "="
do
{
ch=fgetc(in);
}while(ch!='=');
//read the value
fscanf(in,"%s",&Status);
//read characters until encounter "="
do
{
ch=fgetc(in);
}while(ch!='=');
//read the value
fscanf(in,"%s",&Path);
fclose(in);
}//if((in=fopen...
else
{
printf("Cannot open file Info.txt\n"
exit(1);
}//else
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.