String Comparison

Hi all,

I have a file like this

ibhib=ere
wefwfl=werfe
sfdes=wef

From this file, i need to get the lefthand side string with respect to the corresponding righthand side string. i.e, I need to get the string "ere" with respect to "ibhib".

But i am stuck with how to compare a string from a file. using getc can get the lefthand side string in an array(But how)?? Any help wil b greatly appreciated...

abey

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/* this reads files up to twenty lines in length.*/
#define LINES_IN_FILE 20
#define DELIMITER "="

int main(int argc, char *argv[])
{
	FILE *in=fopen("myfile","r");
	char tmp[128]={0x0};
	char left[LINES_IN_FILE][64]={0x0};
	char right[LINES_IN_FILE][64]={0x0};
	int linecount=0;
	char *p=NULL;
	int i=0;

	while(fgets(tmp,sizeof(tmp), in)!=NULL)
	{
		p=strchr(tmp,(int) '\n');
		if(p!=NULL) *p=0x0;
		p=strtok(tmp,DELIMITER);
		if(p!=NULL)
		{
		  strcpy(left[linecount],p);
		  p=strtok('\0',DELIMITER);
		  strcpy(right[linecount++], p);
		}
	}
	fclose(in);
	for(i=0;i<linecount;i++)
	{
		printf("left value is:%s and the matching right value is:%s\n", 
		    left,right);
	}
	return 0;
}