I can't get my function to print characters i have initialised and declared.
#include <stdio.h>
int main() {
char letter1 ="i";
char letter2 ="n";
char letter3 ="C";
printf ("Programming %c%c %c\n", letter1, letter2, letter3);
return 0;
}
I want it to display
"Programming in C"
using
printf ("Programming %c%c %c\n", letter1, letter2, letter3);
I get the following error
main.c:4:8: warning: incompatible pointer to integer conversion
initializing 'char' with an expression of type 'char [2]' [-Wint-
conversion]
char letter1 ="i";
^
I haven't learn about pointers or anything yet, I'm used to simpler languages that just work. I am trying to go through an edX course but I find the quality to be poor and the pacing tedious.
Would be happy if you could help me out here and recommend me better resources for learning C
thanks