Skip to content

Instantly share code, notes, and snippets.

@virtuosonic
Created June 20, 2023 17:14
Show Gist options
  • Save virtuosonic/564c9ea1823076836ead5e54c702f477 to your computer and use it in GitHub Desktop.
Save virtuosonic/564c9ea1823076836ead5e54c702f477 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <tuple>
using namespace std;
int c_style_function(int* n, double* f,const char* c)
{
*n = 42;
*f = 3.14159;
c = "a";
return 0;
}
std::tuple<int,float,std::string_view> cpp_style_function()
{
return {42,3.14159,"a"};
}
int main()
{
auto cpp = cpp_style_function();
int* n;
double ff;
const char* ch;
c_style_function(n,&ff,ch);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment