Last active
October 2, 2019 10:59
-
-
Save achimnol/df464c6a3fe05b21e9b06d5b80e986c5 to your computer and use it in GitHub Desktop.
Sorna C Program Example
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
#include <stdio.h> | |
#include "mylib.h" | |
int main() { | |
// library function in different source file | |
int v = getvalue(); | |
printf("myvalue is %d\n", v); | |
// interactive user input with scanf() | |
char name[1024]; | |
printf("your name? "); | |
fflush(stdout); | |
scanf("%s", name); | |
printf("hello, %s!\n", name); | |
return 0; | |
} |
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
#include "mylib.h" | |
int getvalue() { | |
return 42; | |
} |
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
int getvalue(void); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment