Last active
November 11, 2019 21:48
-
-
Save jozanza/f9d930f3746ebef8b419561147f34e4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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