This time we converted "Hello World" in a modular program. One module contains the message, and one sends the greeting.

Well, that's the way it's supposed to work, something funny is happening.

hello_sub.cpp

// Message to say hello
const char[] message = "Hello World!\n";	

hello_main.cpp

#include <iostream>
extern const char* const message;	// Message to say hello
int main()
{
    std::cout << message;
    return (0);
}

Source code for the string
Source code for main

Hint 1: C++ is only partially typesafe.

Hint 2: The types char* and char[] are almost interchangeable.

Hint 3: "Almost" is a very significant word.

Next Hint
Answer

Main gallery