#include <stdio.h>
#include<stdlib.h>
int main() {
//code
char *ptr,s[]="debasree";
ptr=s[0];
printf("%s\n",*ptr);
return 0;
}
I get this warning in geeks for geeks compiler
Warnings:
prog.c: In function 'main':
prog.c:7:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
ptr=s[0];
prog.c:13:8: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
printf("%s\n",*ptr);
^
and also get
Runtime Errors:
Segmentation Fault (SIGSEGV)
can anyone pls explain what is the warning saying? i googled a lot but could not grasp it… pls pls pls pls explain...