B
Bill Cunningham
I just about have the code I wanted to write written. It compiles but I
have these error codes. This has yet to be converted into an object file and
compiled with some code. What do these errors mean? The compiler wants a
cast and I don't know if I need to convert types use a cast to a similar
type or what. I've tried both these things. Any ideas?
#include <stdio.h>
#define type unsigned int
struct stk {
type date[6];
type price;
type volume;
};
struct stk s, *ps;
struct stk packs(type date[6], type price, type volume)
{
s.date[6] = date[6];
s.price = price;
s.volume = volume;
return s;
}
type unpacks(struct stk * date[6], struct stk * price, struct stk * volume)
{
type date[6];
type price;
type volume;
return date[6] = ps->date;
return price = ps->price;
return volume = ps->volume;
}
mo.c: In function `unpacks':
mo.c:22: warning: declaration of `date' shadows a parameter
mo.c:23: warning: declaration of `price' shadows a parameter
mo.c:24: warning: declaration of `volume' shadows a parameter
mo.c:25: warning: assignment makes integer from pointer without a cast
have these error codes. This has yet to be converted into an object file and
compiled with some code. What do these errors mean? The compiler wants a
cast and I don't know if I need to convert types use a cast to a similar
type or what. I've tried both these things. Any ideas?
#include <stdio.h>
#define type unsigned int
struct stk {
type date[6];
type price;
type volume;
};
struct stk s, *ps;
struct stk packs(type date[6], type price, type volume)
{
s.date[6] = date[6];
s.price = price;
s.volume = volume;
return s;
}
type unpacks(struct stk * date[6], struct stk * price, struct stk * volume)
{
type date[6];
type price;
type volume;
return date[6] = ps->date;
return price = ps->price;
return volume = ps->volume;
}
mo.c: In function `unpacks':
mo.c:22: warning: declaration of `date' shadows a parameter
mo.c:23: warning: declaration of `price' shadows a parameter
mo.c:24: warning: declaration of `volume' shadows a parameter
mo.c:25: warning: assignment makes integer from pointer without a cast