Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

5 семестр / Lab4 / dynamic / dynamic

.c
Скачиваний:
2
Добавлен:
18.02.2023
Размер:
652 б
Скачать
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

extern void search_words(char *file1, char* file2)
{
	FILE *fin, *fout;
	char string1[50], string2[50];
	if((fin = fopen(file1, "r")) != NULL)
	{
		while(!feof(fin))
		{
			if(fgets(string1, 50, fin) != NULL)
			{

				if((fout = fopen(file2, "r")) != NULL)
				{
					while(!feof(fout))
					{
						if(fgets(string2, 50, fout) != NULL)
						{
							string1[strcspn(string1, "\r\n")] = 0;
							string2[strcspn(string2, "\r\n")] = 0;
							if(strcmp(string1, string2) == 0)
								printf("%s;\n", string1);
						}
					}
					fclose(fout);
				}

			}
		}
		fclose(fin);
	}
	return;
}
Соседние файлы в папке dynamic
  • #
    18.02.20238.38 Кб3a4.out
  • #
    18.02.2023652 б2dynamic.c
  • #
    18.02.20232.53 Кб2dynamic.o
  • #
    18.02.20238.28 Кб2libdynamic.so
  • #
    18.02.2023318 б3main.c