[ create a new paste ] login | about

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

C, pasted on Feb 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
  int NumItems = 5;
  char (*NameList)[10];
  NameList = malloc(10*NumItems);

  strcpy(NameList[0], "Hello");
  strcpy(NameList[1], "There");

  printf("%s %s\n", NameList[0], NameList[1]);

  return 0;
}


Output:
1
Hello There


Create a new paste based on this one


Comments: