[ create a new paste ] login | about

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

C, pasted on Sep 2:
#include <stdio.h>
#define SIZE 20

struct Brand{
    char name[SIZE];
    int price;
};

int change_price(struct Brand);

int main(void)
{
    struct Brand coke = {"coca cola", 120};
    printf("%s %d\n", coke.name, coke.price);
    cnange_price(coke);
    printf("%s %d\n", coke.name, coke.price);
    return 0;
}

int change_price(struct Brand)
{
	/* 商品の価格を120から150に変更 */
	return coke.price + 30;
}


Output:
1
2
3
4
5
In function 'change_price':
Line 20: error: parameter name omitted
Line 23: error: 'coke' undeclared (first use in this function)
Line 23: error: (Each undeclared identifier is reported only once
Line 23: error: for each function it appears in.)


Create a new paste based on this one


Comments: