Click here to Skip to main content
15,791,522 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is my code
#include <stdio.h>
int main(){
char Name="Daniel";
printf("Hello My Name Is %s",Name);

This is my error:
warning: initialization makes integer from pointer without a cast [-Wint-conversion]|

What I have tried:

I have tried stackoverflow,I have also looked all over google but couldnt find the awnser.I also tried quora
Updated 1-Nov-22 2:03am

Rick is right but you need to add a
return 0;
at the end of main function!!!

Visit some tutorial like Learn C to improve your coding skills.
Share this answer
As suggested by the others, it should be
#include <stdio.h>

int main()
  const char * name = "Daniel";
  printf("Hello my name is %s\n", name);
  return 0;
Share this answer
That needs to be a "char *".
char * name = "Daniel";
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900