[ create a new paste ] login | about

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

C, pasted on Aug 24:
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(){
 int i = 0;
 static const size_t kBufferSize = 6;
 int *nums = malloc(kBufferSize * sizeof(int));
 memcpy( nums, 
        (int []){ 4, 8, 15, 16, 23, 42 }, 
         kBufferSize * sizeof(int)
 );
 i = 6;
 while(--i)
  printf("%d\n", nums[i]);

 return 0;
}


Output:
1
2
3
4
5
42
23
16
15
8


Create a new paste based on this one


Comments: