[ create a new paste ] login | about

Link: http://codepad.org/mgDt5k4h    [ raw code | output | fork ]

C, pasted on Aug 23:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
struct foo {
  char *str;
};

struct foo make_struct(void) {
  struct foo a;
  a.str = "string";
  return a;
}

int main() {
  struct foo b = make_struct();
  printf("%s\n", b.str);
  return 0;
}
/* end */


Output:
1
string


Create a new paste based on this one


Comments: