Skip to content

Instantly share code, notes, and snippets.

@jozanza
Last active November 11, 2019 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jozanza/f9d930f3746ebef8b419561147f34e4f to your computer and use it in GitHub Desktop.
Save jozanza/f9d930f3746ebef8b419561147f34e4f to your computer and use it in GitHub Desktop.
// This file implements the interface described in its header (greet.h)
#include "greet.h"
#include <stdio.h>
void greet(char* name) {
printf("Hello, %s!\n", name);
}
// This file describes the public interface greet.c should implement
// In this case, a single function, greet()
#pragma once // Ensures header is only included once by the compiler
void greet(char* name);
// This file is our entry-point
#include "greet.h" // Include the header so we can call greet()
int main(void) {
greet("World");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment