Say I have an integer and I want to convert it to a character? What methods are available or should I use in C++? For example, refer to the given code below
#include <bits/stdc++.h>
using namespace std;
int main
{
int i = 1;
// Say I want to convert 1 to a char '1';
// How do I achieve the following in C++
}
char c = digit + '0' ;
It will do your work.
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