I am new to C. I just want to know why initializing the array of int with int is working and why initializing an array of char with char is not working. Or am I wrong thinking that "1" is a char?
#include <stdio.h>
int main()
{
int incoming_message_test[2] = {1, 2}; // why does this work?
char incoming_message[2] = {"1", "2"}; // why does this not work?
return 0;
}
You must change "1", "2" with '1', '2'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With