[ create a new paste ] login | about

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

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

#define MAXSIZE 2
typedef struct
{
    int r[MAXSIZE+1];
    int length;
}sqlist;

int main()
{
    sqlist* L  = (sqlist *) malloc(sizeof(sqlist));

    L->r = {1,2,3};
    int i =0; 
    for( i = 0; i < MAXSIZE +1 ; i ++) 
        printf("sqlist new r[%d] = %d \n",i+1, L->r[i]);
}


Output:
1
2
In function 'main':
Line 16: error: expected expression before '{' token


Create a new paste based on this one


Comments: