[ create a new paste ] login | about

Link: http://codepad.org/WksTLJAm    [ raw code | fork ]

C, pasted on May 30:
// foo.h

#ifndef INCLUDED_FOO_H
#define INCLUDED_FOO_H

struct foo {
  unsigned XX;
};

extern struct foo bar;

#endif

// foo.c

#include "foo.h"

struct foo bar = { 123 };

// main.c

#include "foo.h"

int main(void) {
  bar.XX += 2;
  // bar.XX is now 125.
}


Create a new paste based on this one


Comments: