P
Plissken.s
Hi,
I have a structure like this:
typedef struct {
char* buffer;
int len;
} buffer_t;
static buffer_t* buffer[BUFSIZE];
And I want to implement a function which set the input pointer, points
to the first element of buffer.
int getItem(buffer_t** itemp) {
//
*itemp = &(buffer[0]);
return 1;
}
I can't get the following code to work,
main() {
buffer_t* p;
getItem(p);
// p should points to buffer[0] after return from getItem(),
}
I have a structure like this:
typedef struct {
char* buffer;
int len;
} buffer_t;
static buffer_t* buffer[BUFSIZE];
And I want to implement a function which set the input pointer, points
to the first element of buffer.
int getItem(buffer_t** itemp) {
//
*itemp = &(buffer[0]);
return 1;
}
I can't get the following code to work,
main() {
buffer_t* p;
getItem(p);
// p should points to buffer[0] after return from getItem(),
}