I wrote this program
#include<stdio.h>
int main ()
{
int a;
char * c,d;
c="Onus";
d="animation";
printf("\n%s",c);
printf("\n%s",d);
}
but upon compiling I got following warning
temp.c: In function ‘main’:
temp.c:7: warning: assignment makes integer from pointer without a cast
temp.c:9: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’
and when I executed it executed with following errors
./a.out
Onus
Segmentation fault
Can some one point me as what is wrong in above and why am I getting warning?