Created
June 20, 2023 17:14
-
-
Save virtuosonic/564c9ea1823076836ead5e54c702f477 to your computer and use it in GitHub Desktop.
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 <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