i used your advise and have changed to fgets somehow i am still unable to get my checker to read in the string..
windows.h is for the pause function
Code:
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <stdlib.h>
main()
{
char input1[100], input2[100];
char *p,*q;
char checker[100];
int i,j,n,m;
printf("Please enter a string : ");
fgets(input1, 100, stdin);
printf("Please enter the code : ");
fgets(input2, 100, stdin);
p = input1;
q = checker;
n = strlen(input1);
m = strlen(input2);
m = m-1;
while(*p != '\0')
{
for(j=0;j<m;j++)
{
*(q+j) = *(p+j);
}
printf("%s\n%s\n",checker,input2);
if (strcmp(checker,input2) == 0)
printf("Matched at %d\n", i+1);
// x = strcpy(checker,input2);
p++;
}
system("pause");
}