Compare strings - file functions
#1

I want to know how many "GranaT3" I have in my file "name.txt"

Код:
new File:handle = fopen("name.txt", io_read), buf[128];
 
	if(handle)
	{
		while(fread(handle, buf))
		{
                     if(!strcmp(buf, "GranaT3", true))
                     {
                     printf("%s", buf);
                     }
		}  			
	}

	else
	{
		print("The file \"file.txt\" does not exists, or can't be opened.");
	}
But nothing prints (code does not work). What would be the right way ?.
Reply


Messages In This Thread
Compare strings - file functions - by GranaT3 - 02.12.2015, 02:21
Re: Compare strings - file functions - by CmZxC - 02.12.2015, 02:30
Respuesta: Re: Compare strings - file functions - by GranaT3 - 02.12.2015, 02:41
Re: Compare strings - file functions - by CmZxC - 02.12.2015, 02:44
Respuesta: Compare strings - file functions - by GranaT3 - 02.12.2015, 02:49
Re: Compare strings - file functions - by Kevln - 02.12.2015, 03:20

Forum Jump:


Users browsing this thread: 1 Guest(s)