User Profile

Collapse

Profile Sidebar

Collapse
liyankka
liyankka
Last Activity: May 29 '07, 06:32 PM
Joined: Nov 15 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • liyankka
    replied to how to read fields of a struct from file
    in C
    Yes I do understand the functions performed by malloc and free.Though I
    use malloc(and calloc) often , I haven't worked much with free(may be because I wrote small programs ). For the allocations done in this program, i'm sending that section too.


    [code=c]#include "record.h"
    int main()
    {
    FILE * f1,*f2;
    Record record,record1;
    int i;
    void *buff;
    ...
    See more | Go to post

    Leave a comment:


  • liyankka
    replied to how to read fields of a struct from file
    in C
    Though fread reads the written record, it only repeatedly shows the last record read , as many times as many records were written into the file.

    I'm able to get all records using fscanf, but i also want to know how it could be done using fread and void pointers. So, Please tell....
    See more | Go to post

    Leave a comment:


  • liyankka
    replied to how to read fields of a struct from file
    in C
    Thank you for help. I could read both using fread and fscanf in different copies of
    the same proogram by allocating memory(malloc) char * fields of the struct or else by scanf/printf on each field separately .
    See more | Go to post

    Leave a comment:


  • liyankka
    started a topic extracting packet info using libipq C library
    in C

    extracting packet info using libipq C library

    I need to extract packet info (the destination address , time of arrival and destination port), for this i'm using libipq and netinet/ip.h (C libraries). The problem is that struct iphdr contains IP address while I should know the DNS name,to be required by my program to compare it with a DNS name in my program . How could this be obtained ?

    Please help .(required with urgency )
    See more | Go to post

  • liyankka
    started a topic how to read fields of a struct from file
    in C

    how to read fields of a struct from file

    The following code writes into the file but is unable to retrieve fields of the struct
    conf_record in the printf (after fread within while loop) statement.Pleas e give a solution.

    [code=c]/* record.h */
    typedef struct conf_record {
    char *source_IP;
    char *dest_IP;
    char *s_port;
    char *d_port;
    //char** range_allow;//[2];
    char *range_disallow[2];
    } Record;...
    See more | Go to post
    Last edited by AdrianH; May 29 '07, 12:25 PM. Reason: Please use [code=c][/code] tags to improve readability. Also INDENT YOUR CODE!

  • liyankka
    started a topic how to read a fields of a struct from file

    how to read a fields of a struct from file

    The following code writes into the file but is unable to retrieve fields of the struct
    conf_record in the printf (after fread within while loop) statement.Pleas e give a solution.

    /* record.h */
    typedef struct conf_record{
    char * source_IP;
    char * dest_IP;
    char* s_port;
    char* d_port;
    //char** range_allow;//[2];
    char* range_disallow[2];
    }Record;

    /*...
    See more | Go to post

  • liyankka
    started a topic error installing apache

    error installing apache

    I'm installing apache and php on a Fedora linux OS where while configuring
    Apache following error occured:

    configure: error: Cannot use an external APR-util with the bundled APR

    Please help.
    See more | Go to post
No activity results to display
Show More
Working...