Hi

I'm new to C++ and need help urgently.

I need a C++ program that converts letters into ASCII numbers.

For example if I enter a name James Bond the output would be 66 and 74

Thanks

SallyJ

Hi

I'm new to C++ and need help urgently.

I need a C++ program that converts letters into ASCII numbers.

For example if I enter a name James Bond the output would be 66 and 74

Thanks

SallyJ

Typecast the char to an int:

#include <iostream>
using namespace std;

int main ()
{
    char letter = 'B';
    cout << (int) letter;
    return 0;
}

Output will be 66.