Skip to content

Instantly share code, notes, and snippets.

@ZhangBowen
Created April 10, 2013 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZhangBowen/5353428 to your computer and use it in GitHub Desktop.
Save ZhangBowen/5353428 to your computer and use it in GitHub Desktop.
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