Skip to content

Instantly share code, notes, and snippets.

@zachelko
Created April 8, 2010 00:52
Show Gist options
  • Save zachelko/359642 to your computer and use it in GitHub Desktop.
Save zachelko/359642 to your computer and use it in GitHub Desktop.
Test case
//utils.h
#ifndef UTILS_H
#define UTILS_H
#include
struct Point2d
{
float x;
float y;
void print()
{
std::cerr << x << "," << y << std::endl;
}
};
void utilsFoo()
{
int x = 2;
}
#endif
//foo.h
#include "utils.h"
#ifndef FOO_H
#define FOO_H
struct Foo
{
int x;
int y;
};
void foo(Point2d);
#endif
//foo.cpp
#include "utils.h"
#include "foo.h"
void foo(Point2d point)
{
int x = 4;
point.x = 5;
}
//main.cpp
#include "utils.h"
#include "foo.h"
int main()
{
Foo foo = {1, 1};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment