You can convert a char type simply by assigning to an int.
Casting int to char involves losing data and the compiler will probably warn you. Extracting a particular byte from an int sounds more reasonable and can be done like this
This question already has answers here: Converting int to char in C (7 answers).
I want to add values to char[] using int values.
I have a char that is given from fgets, and I would like to know how I can convert it into a char*. I am sure this has been posted before, but I couldn't find one that was doing quite what I wanted to do.
char res[10]="start "; size_t len = strlen(res)
printsize(char); /* according to the C standard this is always 1 */.
Normally, functions that take a char * argument require a pointer to a null terminated string. If you take the address of a char typed variable and use that pointer in the function call you will certainly satisfy the compiler but the function...
TV9 Telugu Live is a 24/7 news channel in Andhra Pradesh and Telangana. Watch the latest Telugu news LIVE on the most subscribed news channel on YouTube. Watch all the current, latest and breaking ...