I have a char buf[3]; array where I need to put: buf[0] = ch where ch is an int. But the compiler give the following warning:
conversion to ‘char’ from ‘int’ may alter its value
How do I remove this? I tried cast to unsigned char but no luck.
Use an explicit cast: