Skip to content

Instantly share code, notes, and snippets.

@7shi
Forked from shigemk2/deep_cpy.cpp
Last active August 29, 2015 14:21
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 7shi/683925192172db8ab484 to your computer and use it in GitHub Desktop.
Save 7shi/683925192172db8ab484 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct A{
char s[10000];
A() {
strcpy(s, "123");
}
A(const A &a) {
memcpy(s, a.s, sizeof(s));
}
void printn() {
printf("%s\n", s);
}
};
int main() {
A a;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment