Print given sentence into its equivalent ASCII form | C ++ implementation for converting a string into it 's ASCII equivalent sentence ; Function to compute the ASCII value of each character one by one ; Driver function
#include <bits/stdc++.h> NEW_LINE using namespace std ; void ASCIISentence ( std :: string str ) { int l = str . length ( ) ; int convert ; for ( int i = 0 ; i < l ; i ++ ) { convert = str [ i ] - NULL ; cout << convert ; } } int main ( ) { string str = " GeeksforGeeks " ; cout << " ASCII ▁ Sentence : " << std :: endl ; ASCIISentence ( str ) ; return 0 ; }