Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of Isaac Tait

Isaac Tait

Isaac Tait has asked 0 questions and find answers to 1 problems.

Stats

43
EtPoint
17
Vote count
0
questions
1
answers

About

Header.h

#pragma once
#ifndef CONSTANTS_H

namespace constants {
    double code[12] = {72,101,108,108,111,32,87,111,114,108,100,33};
}
#endif // !CONSTANTS_H

main.cpp

#include <iostream>
#include "Header.h"

int main() {
    for (int i{ 0 }; i <= std::size(constants::code); ++i) {
        double number = constants::code[i];
        std::cout << static_cast<char>(number);
    }
    //Or written another way using a type alias
    for (int i{ 0 }; i <= std::size(constants::code); ++i) {
        double num = constants::code[i];
        std::cout << int_least8_t(num);
    }
    return 0;
}

Isaac Tait questions