Char

char.h
1
2
3
4
5
6
7
8
#ifndef EXAMPLES_CHAR_H_
#define EXAMPLES_CHAR_H_

#include <iostream>

void displayChar();

#endif /* EXAMPLES_CHAR_H_ */
char.cpp
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "char.h"

using namespace std;

void displayChar()
{
    unsigned char c = '\001';
    int i = 0;

    while (c <= '\177')
    {
        cout << c;

        c++;
        i++;

        if (i == 40)
        {
            cout << endl;
            i = 0;
        }
    }

    cout << endl;
}