The proposal is to create a program that compares the n positions of the two vectors and returns whether they are equal or not. So far so good, but I do not know how I can ignore case sensitive .
Here's what I've done so far:
//Questão 7
#include <stdio.h>
#define MAX 5
int memcpy(char s1[], char s2[], int n);
int main()
{
char s1_m[MAX]={'a', 'b', 'c', 'd', 'e'}, s2_m[MAX]={'a', 'b', 'c', 'D', 'E'};
int n_m;
printf("quantos caracteres serao verificados(max 5)\n> "); scanf("%d", &n_m); fflush(stdin);
printf("os %d primeiros caracteres dos dois vetores %s iguais", n_m, memcpy(s1_m, s2_m, n_m)?"sao":"nao sao");
return 0;
}
int memcpy(char s1[], char s2[], int n)
{
int i, contador=0;
for(i=0;i<n;i++)
{
if(s1[i]==s2[i])
contador++;
else
break;
}
if(contador==n)
i=1;
else
i=0;
return i;
}