How to convert char to int in C++

1 Answer

0 votes
#include <iostream>

int main()
{
    char ch = 'c';
    
    int n = ch;
    
    std::cout << n;
    
    return 0;
}



  
/*
run:
  
c++
 
*/

 



answered Sep 20, 2021 by avibootz

Related questions

1 answer 264 views
3 answers 454 views
454 views asked May 16, 2021 by avibootz
1 answer 289 views
1 answer 272 views
272 views asked Feb 28, 2021 by avibootz
1 answer 378 views
378 views asked Jun 13, 2017 by avibootz
2 answers 362 views
362 views asked Apr 2, 2017 by avibootz
1 answer 288 views
...