Skip to content

Instantly share code, notes, and snippets.

@achimnol
Last active October 2, 2019 10:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achimnol/df464c6a3fe05b21e9b06d5b80e986c5 to your computer and use it in GitHub Desktop.
Save achimnol/df464c6a3fe05b21e9b06d5b80e986c5 to your computer and use it in GitHub Desktop.
Sorna C Program Example
#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;
}
#include "mylib.h"
int getvalue() {
return 42;
}
int getvalue(void);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment