B
Bill Cunningham
Here is a list of prototypes and that's all I have so far for a program
I want to write. This should be simple for even me but since I am packing
the struct and I am then going to save it to file, well this is the first
time I've programmed stucts myself. I have used them in things like the
sockets API for unix but that's about it. I have never really designed them.
Well I am looking for feedback in these function's design as far as the
prototypes go since I am using the struct. Are all these parameters after
the first one that is going to take a struct stk*; necessary?
//sread is for reading in securities data.
//swrite is for obtaining it.
#include <stdio.h>
#include <stdlib.h>
#include <ctypes.h>
struct stk {
int volume;
int date[9];
double price;
char *name;
};
void *sread(struct stk *, int, int, double, char *);
void *swrite(struct stk *, int, int, double, char *);
/* There's really nothing of course here to compile yet but are the 2 ints,
doubles and the char * needed to pack the struct? They would be if I was
going to not use a struct but are they needed to pack the struct using
pointers?
*/
B
I want to write. This should be simple for even me but since I am packing
the struct and I am then going to save it to file, well this is the first
time I've programmed stucts myself. I have used them in things like the
sockets API for unix but that's about it. I have never really designed them.
Well I am looking for feedback in these function's design as far as the
prototypes go since I am using the struct. Are all these parameters after
the first one that is going to take a struct stk*; necessary?
//sread is for reading in securities data.
//swrite is for obtaining it.
#include <stdio.h>
#include <stdlib.h>
#include <ctypes.h>
struct stk {
int volume;
int date[9];
double price;
char *name;
};
void *sread(struct stk *, int, int, double, char *);
void *swrite(struct stk *, int, int, double, char *);
/* There's really nothing of course here to compile yet but are the 2 ints,
doubles and the char * needed to pack the struct? They would be if I was
going to not use a struct but are they needed to pack the struct using
pointers?
*/
B