How can i add Add two int chars together into one char array or string like :
char *s;
int a = 'A';
int b = 'B';
s = a + b;
the terminal givs me :
incompatible integer to pointer conversion assigning to 'char *' from 'int'
How can i add Add two int chars together into one char array or string like :
char *s;
int a = 'A';
int b = 'B';
s = a + b;
the terminal givs me :
incompatible integer to pointer conversion assigning to 'char *' from 'int'
Have a look at sprintf
to print the values to a string.
char my_cstring[32] = "";
char a = 'A';
char b = 'B';
sprintf(my_cstring, "%c%c", a, b);
// output: "AB"