Skip to content

Instantly share code, notes, and snippets.

@scooby
Created February 8, 2009 05:34
Show Gist options
  • Save scooby/60216 to your computer and use it in GitHub Desktop.
Save scooby/60216 to your computer and use it in GitHub Desktop.
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;
struct f {
char x[16];
};
f& padded_string(char* y) {
cout << y << endl;
f* o;
o = new f;
cout << o << endl;
(void) strncpy(o->x, y, sizeof o->x);
return *o;
};
int main(void) {
f oo;
oo = padded_string("dsdf");
vector<f> s;
s.push_back(oo);
return 1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment