Answers for "c++ char to int ascii"

C++
10

c++ get ascii value of char

#include<iostream>
using namespace std;
int main ()
{
    char c;
    cout << "Enter a character : ";
    cin >> c;
    cout << "ASCII value of " << c <<" is :  " << (int)c;
    return 0;
}
Posted by: Guest on June-24-2020
-5

converting char to int in c++

#include <sstream>

using namespace std;

int main()
{
    stringstream str;
    
    str << "1";

    double x;
    str >> x;
}
Posted by: Guest on March-21-2020

Browse Popular Code Answers by Language