Skip to content

Instantly share code, notes, and snippets.

@sharkdp
Created September 12, 2017 18:05
Show Gist options
  • Save sharkdp/45cb7cc0087137566cac6fde462240d1 to your computer and use it in GitHub Desktop.
Save sharkdp/45cb7cc0087137566cac6fde462240d1 to your computer and use it in GitHub Desktop.
#pragma once
extern double pi;
#include "constants.h"
#include "initialize.h"
double pi;
void initializeConstants() {
pi = 3.0;
}
#pragma once
#include "constants.h"
void initializeConstants();
#include <iostream>
#include "constants.h"
#include "initialize.h"
int main(int, char**) {
initializeConstants();
std::cout << pi << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment