Здесь простое решение с использованием функции sscanf
.
#include <stdio.h>
#include <stdlib.h>
int main( int argc,char *argv[])
{
int var1,var2;
char *buffer=NULL,c;
size_t bufsize = 32;
size_t characters;
FILE *fp;
if( argc != 2)
return -1;
buffer = (char *)malloc(bufsize * sizeof(char));
fp = fopen(argv[1],"r");
if( fp == NULL)
return -2;
characters = getline(&buffer,&bufsize,fp);
buffer[characters-1]='\0';
sscanf( buffer, "aux = \"%c=%d+%d\"",&c,&var1, &var2 );
printf("var1 = %d , var2 = %d \n",var1,var2);
return 0;
}