I've created an algorithm that simulates a stock of a DVD sale. It stores name, price, and quantity. It has some functions and enters them, one that informs the quantity and the price of a specific dvd and it is in that I am having problems.
After calling the function and pulling the struct data, it should display the name, price, and units. My problem is that I can only search and return strings with up to 3 letters.
Example: If I register and then search for "Max", it works fine, but if it is "Maax", it does not find anything.
Follow the code if someone can help me
void pesquisa(struct locadora v4[MAX])
{ int x;
char pesquisa[100];
printf ("\nInforme o nome de qual Dvd você quer buscar: ");
scanf("%s", &pesquisa);
for(x=0;x<MAX;x++)
if ( strcmp ( pesquisa, v4[x].dvd)==0)
printf ("\nO preço do dvd %s é R$ %.2f. Ele possui %d unidades em estoque!!\n", v4[x].dvd, v4[x].preco, v4[x].quant);
else
printf ("\nNão foi encontrado nenhum registro com esse nome");
}