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;
}