Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
taobao ngxin issue #63
#include <cstdio>
#include <cstring>
using namespace std;
struct test
{
int len;
char * data;
};
test create(char *data)
{
test ans;
ans.len=strlen(data);
ans.data=data;
return ans;
}
int main()
{
test temp;
temp =create("hello world");
printf("%s\n",temp.data);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment