Skip to content

Instantly share code, notes, and snippets.

@cwshu
Last active November 18, 2018 06:32
Show Gist options
  • Save cwshu/e0d3cd4f0c618b43af753341b79f0910 to your computer and use it in GitHub Desktop.
Save cwshu/e0d3cd4f0c618b43af753341b79f0910 to your computer and use it in GitHub Desktop.
arduino....
int foo(int a, int b)
{
return a+b;
}
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
int foo(int a, int b);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#ifdef __cplusplus
int foo(int a, int b = 10);
#endif // __cplusplus
#include <cstdio>
#include "foo.h"
int main(int argc, char *argv[]){
printf("%d, %d\n", foo(1, 2), foo(20));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment