how to interate from a to z in c++ code example

Example 1: typage in python

# for a string named str1
str1: str = "this is a string"
#for an int named toto
toto: int
#and it works for every types (str, int, floats, dict...)

Example 2: fail() in c++

#include <iostream>
using namespace std;

int main()
{
    int number;
    do{
        cin >> number;
        if(cin.fail())
            cout << "Not a number " << endl;
    }while(!cin.fail());
    cout << "number is " << number << endl;
    system("pause");
    return 0;
}

Tags:

Cpp Example