All pastes #97021 Raw Edit

Unnamed

public c v1 · immutable
#97021 ·published 2006-07-23 09:55 UTC
rendered paste body
[pdt@c-68-53-40-50 mod_voicemail]$ cat test.c#include <stdio.h>#include <stdlib.h>typedef struct test_struct test_struct;struct test_struct {        int var1;        int var2;};static void increment(test_struct* test) {        test.var1++;}int main(char** argv, int argc) {        test_struct *tsst;        test = malloc(sizeof(*test));        test.var1 = 1;        test.var2 = 2;        increment(test);        fprintf(stdout, "test.var1: %d", test.var1);}[pdt@c-68-53-40-50 mod_voicemail]$ gcc test.c -o testtest.c: In function ‘increment’:test.c:12: error: request for member ‘var1’ in something not a structure or uniontest.c: In function ‘main’:test.c:18: error: ‘test’ undeclared (first use in this function)test.c:18: error: (Each undeclared identifier is reported only oncetest.c:18: error: for each function it appears in.)