Created
September 28, 2019 20:06
-
-
Save Silva97/bbbf8ac4aef520374a30c56a585fac3d to your computer and use it in GitHub Desktop.
Exemplo para o artigo "Modularizando código em C"
This file contains hidden or 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
| // https://medium.com/@FreeDev/modularizando-c%C3%B3digo-em-c-784dc52d1c34 | |
| #include <stdio.h> | |
| #include "module.h" | |
| int main(void) | |
| { | |
| printf("Valor: %d\n", sum(3, 7)); | |
| return 0; | |
| } |
This file contains hidden or 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
| #include "module.h" // Neste caso nem seria necessário, mas né? | |
| int sum(int x, int y) | |
| { | |
| return x + y; | |
| } |
This file contains hidden or 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
| #ifndef _MODULE_H | |
| #define _MODULE_H | |
| int sum(int, int); | |
| #endif // _MODULE_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment