Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   C (https://www.askmehelpdesk.com/forumdisplay.php?f=438)
-   -   C programming (https://www.askmehelpdesk.com/showthread.php?t=4475)

  • Aug 1, 2003, 05:54 PM
    mehdi
    C programming
    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
  • Nov 13, 2003, 08:19 AM
    kave
    C programming
    Salam:
    Khoshhalam ke ye hamzaboon inja mibinam damet garm


    Chakeret
  • Jan 14, 2009, 10:28 PM
    GeethaShankar

    how to prepare pi chart in c language

  • All times are GMT -7. The time now is 11:05 PM.