
12.12.2008, 11:25
|
|
Участник форума
Регистрация: 03.01.2008
Сообщений: 156
С нами:
9660439
Репутация:
110
|
|
а можно написать что-то своё ^____--
Код:
#include <stdio.h>
#include <conio.h>
#include <string.h>
#define BUFFSIZE 100
int main(int argc, char *argv[])
{
FILE *in_file;
char buffer[BUFFSIZE];
char word[BUFFSIZE];
int counter = 0;
int wordflag = 0;
int offset = 0;
if(argc != 2)
{
printf("USAGE : filter file");
return 1;
}
in_file = fopen(argv[1], "rb");
if(in_file == NULL)
{
printf("Error : unable to open file %s", argv[1]);
getch();
return 2;
}
else
printf("File %s is open\n", argv[1]);
while(fread(buffer, 1, 1, in_file) > 0)
{
if(buffer[0] >= ' ' && buffer[0] <= '~')
{
if(wordflag != 1)
wordflag = 1;
word[counter] = buffer[0];
counter++;
}
else
{
if(counter != 0)
{
word[counter + 1] = '\0';
if(strlen(word) > 5)
printf("%8.8X : %s\n", offset, word);
}
counter = 0;
wordflag = 0;
}
offset++;
}
getch();
return 0;
}
но это лирика ... и к Юникоду не подходит ...
|
|
|