Ok I started messing around with stuff and it works...with 7 warnings.
It still doesn't append the line char though. Here is the ugly freak of my programming
int searchnum = 0;
char search;//make a char for the search parameters
strcpy(search,"hi");//make search equal 'hi'
FILE *pfile;//make a file pointer
pfile = fopen("searchfile.txt","r");//open the file for reading
printf("searchtext: %s ",search);//show the user what is being searched for
if (pfile == NULL)//if the file does not exist...
printf("file does not exist, you fail");//... tell the user he is a fail :D
getch();//get a message from the keyboard then end the program
return 0;//tell there were no errors
else//if the file does exist...
while((lineh=fgetc(pfile)) != EOF)//...read it one character at a time
printf("\nlineh at top:%c",lineh);//see what the program gets here to see if it taking
//the right path
if (isspace(lineh))//if the character is a whitespace...
if (strcmp(line,search) == 0)//...see if it equals what we are searching for
searchnum + 1;//if it does equal what we want add one
printf("found %d\n",searchnum);//tell the user we found
strcpy(line,"");//erase everything in line
else//if the character isn't a whitespace add to the line
printf("\nlineh else: %c\n",lineh);//show what lineh equals
lineh = linea;
strcat(lineh,line);//append line to accomodate lineh
printf("\nline: %s",line);//tell the user what is in line at the moment
printf("%d",searchnum);//after the loop tell how many 'hi's were found
getch();//get input from the keyboard then quit
Can you see what I am doing wrong, thanks.