W
walsht
When I compile the code snipets below I'm producing the error: storage
size of 'frm' isn't known.
dll.h :
/*
* File: dll.cpp
* Defines the data link layer's interface.
*/
#ifndef __FRAME_
#define __FRAME_
typedef unsigned int frame_kind;
typedef unsigned int seq_nr;
struct {
frame_kind kind;
seq_nr seq;
seq_nr ack;
char data[100];
}; frame
#endif
dataLinkSend() :
void dataLinkSend(int sd, char* data, seq_nr last) {
struct frame frm;
frm.kind = data;
frm.seq = (last++)%3;
frm.ack = last;
frm.data = data;
if(send(sd, frm, sizeof(frm), 0) < 0) {
fprintf(stderr, "Couldn't send frm\n");
exit(1);
}
}
If you need the whole file that dataLinkSend() id in, let me know and I
can post it.
size of 'frm' isn't known.
dll.h :
/*
* File: dll.cpp
* Defines the data link layer's interface.
*/
#ifndef __FRAME_
#define __FRAME_
typedef unsigned int frame_kind;
typedef unsigned int seq_nr;
struct {
frame_kind kind;
seq_nr seq;
seq_nr ack;
char data[100];
}; frame
#endif
dataLinkSend() :
void dataLinkSend(int sd, char* data, seq_nr last) {
struct frame frm;
frm.kind = data;
frm.seq = (last++)%3;
frm.ack = last;
frm.data = data;
if(send(sd, frm, sizeof(frm), 0) < 0) {
fprintf(stderr, "Couldn't send frm\n");
exit(1);
}
}
If you need the whole file that dataLinkSend() id in, let me know and I
can post it.