I am just learning C/C++. My problem is to determine if a character is or isn't within an array then returning an appropriate message to the user. I've only gotten this far using 'strchr' without much success. Any suggestions or help would be appreciated. Should I be using pointers instead within the function?
Thank you
Program Char Search */
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char check(char c, char str);
main()
{ char response;
char strg[] = "Array test";
printf("%s\n", strg);
{ Printf("Enter the character you would like to search for.");
Scanf(" %c\n", &response);
}
/*function 'check'*/
{
char check(char str[],char c);
str = strg;
c = response;
scanf("strchr: %s\n",&strg);
if strchr=c
printf("The character is %s\n",c);
}
return 0;
}