hey guyz, i'm trying to search each ar for matching characters in the buff, but I seem to be getting a buffer overflow. Can anyone give me any pointers, any help would be appreciated, this is my code:
#include <stdio.h>
#include<stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
main(int ab, char** ar)
{
char buff[800];
int n_chars;
int i;
char *pch[300];
printf("\nplease enter text => ");
fgets(buff, sizeof(buff), stdin);
for (i=0;i<ab;i++)
{
pch[i] = strpbrk (ar[i],buff);
printf ("%c ",pch[i]);
pch[i] = strpbrk (pch[i],buff);
}
}