I'm trying to check if pointer is pointing at some char.
Like this:
#include<stdio.h>
#include<string.h>
#define a 3
int func(char *);
int main()
{
char *s="a";
int type;
type=func(s);
printf("%d",type);
return 0;
}
int func(char *s)
{
int type;
if(*s=="a")
{
type=1;
}
return type;
}
But I constantly get warning: warning: comparison between pointer and integer if(*s=="a")
Is it possible to compare pointer and integers?
Is there another way to resolve this problem?
Can I find out at which letter is pointing *s without printing it?