PDA

View Full Version : C programming


mehdi
Aug 1, 2003, 05:54 PM
I need some help from you regarding a particular problem.

I am using libnet raw packet library (libnet_build_ethernet) for
transferring data over the network. For this, I have to first convert
all the data to u_char type and then serialize them to contiguous memory
locations.

Can anyone of you give me an idea how can I do that. I tried with
something like following piece of code -

----------------------------------------------------------
char *a;
char *b;
char *c;
char *payload;

struct test{
int a;
int b[2];
int c;

}test1;


test1.a = 5;
test1.b[0] = 6;
test1.b[1]= 7;
test1.c = 8;

a = (char *)&test1.a;
b = (char *)&test1.b;
c = (char *)&test1.c;

printf("%p %p %p\n", a, b, c);

*payload = *a;
*payload+1 = *b;
*payload+3 = *c;

//printf("%p %p %p %p\n", payload,a, b, c);
----------------------------------------------------------------

but I come down with some problem like __dereferencing_frame_info (I
don't know what does that mean, I am pretty new in this area.).

Any help is greatly appreciated.

Regards

kave
Nov 13, 2003, 08:19 AM
Salam:
Khoshhalam ke ye hamzaboon inja mibinam damet garm


Chakeret

GeethaShankar
Jan 14, 2009, 10:28 PM
how to prepare pi chart in c language