Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to print a character with its ascii value in c++

//It is almost know to everybody , how to print an ASCII code of a character.
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int var=65;
	cout<<(char)var<<endl; //By this way, you can get the character with that mentioned ASCII code.
	return 0;
}
Comment

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: splice string in c++ 
Cpp :: how to easily trim a str in c++ 
Cpp :: aray of functions in c++ 
Cpp :: C++ cin cout 
Cpp :: play audio c++ 
Cpp :: vector size for loop 
Cpp :: on component begin overlap c++ 
Cpp :: iterate vector in reverse c++ 
Cpp :: input in c++ 
Cpp :: how to get the type of a variable in c++ 
Cpp :: C++ String Copy Example 
Cpp :: lutris 
Cpp :: indexing strings in c++ 
Cpp :: how to declare a 2d boolean vector in c++ 
Cpp :: is power of 2 
Cpp :: iterate over vector in c++ 
Cpp :: deep copy c++ 
Cpp :: cpp create lambda with recursion 
Cpp :: c++ ternary operator 
Cpp :: chudnovsky algorithm c++ 
Cpp :: Program To Calculate Number Power Using Recursion In C++. The power number should always be positive integer. 
Cpp :: how to split string into words c++ 
Cpp :: notepad++ 
Cpp :: how to get hcf of two number in c++ 
Cpp :: dynamic memory c++ 
Cpp :: how to make a comment in c++ 
Cpp :: Give an algorithm for finding the ith-to-last node in a singly linked list in which the last node is indicated by a null next reference. 
Cpp :: c++ random number 
Cpp :: c++ inheritance 
Cpp :: data types in c++ 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =