Search:

Type: Posts; User: doraiashok

Search: Search took 0.00 seconds.

  1. Replies
    9
    Views
    1,281

    They both do the same, But some people use...

    They both do the same,

    But some people use <constant>==<variable> condition because in case you replace == with =, you can easily identify it.
  2. Replies
    10
    Views
    2,591

    Still there is problem with the code below, ...

    Still there is problem with the code below,


    #include <stdio.h>
    #include <stdlib.h>

    int main(void){

    char c;
  3. Replies
    16
    Views
    3,972

    I am pleased to help you and please ask any more...

    I am pleased to help you and please ask any more doubts in files ,linked list or any other thing in C.

    Thanks
  4. Replies
    2
    Views
    3,842

    With SO_ATTACH_FILTER you will have to specify...

    With SO_ATTACH_FILTER you will have to specify the filter code but i want to block all IP packets and send only the packets, which may be useful.

    (Definition of useful may be dependent on data...
  5. Replies
    16
    Views
    3,972

    The code below will work, Try it. void...

    The code below will work, Try it.



    void add_odd_in_lefe_linked(ptr *head)
    {
    ptr p,q,r,prev;
    for(q=(*head);q->next!=NULL;q=q->next);
    //q contains the last element
    prev=NULL;
  6. Replies
    16
    Views
    3,972

    This code will work. void del_freq(ptr...

    This code will work.



    void del_freq(ptr *head)
    {
    ptr p,q,prev,prev1;
    int flag = 0;
    for(p=*head;p!=NULL;p=p->next )
    {
  7. Replies
    5
    Views
    1,816

    Analysis of the allocation statement: ...

    Analysis of the allocation statement:



    entpairs[i].key = (char*) malloc(MAX_ENTITY_KEYLENGTH*sizeof(char));


    In the code above, i don't think there can be anything wrong to the right hand...
  8. Replies
    16
    Views
    3,972

    Could you please attach the entire code. I will...

    Could you please attach the entire code. I will try to debug it and give you back.

    Thanks.
  9. Replies
    16
    Views
    3,972

    Sorry, I forgot that but if you do this, the p =...

    Sorry, I forgot that but if you do this, the p = p->next in the outer for-loop has to be removed. So the code now looks as below,



    void del_freq(ptr *head)
    {
    ptr p,q,r;
    ...
  10. Replies
    16
    Views
    3,972

    Input: 1->2->1->3->2->1->4 Output: 3->4 ...

    Input:
    1->2->1->3->2->1->4

    Output:
    3->4

    The code below does above,
  11. Replies
    2
    Views
    3,842

    Packet Filter using Unix Socket

    I had by mistake posted in the C programming board,

    http://cboard.cprogramming.com/showthread.php?s=&threadid=48181

    Please take a look at the link and help me out.

    Thanks.
  12. Replies
    3
    Views
    1,555

    Which platform are you using, MS-Windows or...

    Which platform are you using, MS-Windows or Linux.

    In Linux, You have to use CURSES Library

    In MS-Windows, varies from compiler to compiler.

    So tell about the platform you are using.
  13. Replies
    16
    Views
    3,972

    Adding q=p; in the code (see below) should do, ...

    Adding q=p; in the code (see below) should do,



    void del_freq(ptr *head)
    {
    ptr p,q;
    for(p=*head;p!=NULL;p=p->next)
    {
    for(q=p->next;q!=NULL;q=q->next)
  14. Replies
    3
    Views
    5,126

    Since the project is in the test level, there are...

    Since the project is in the test level, there are only two computers in the network which are connected via a hub.

    To test the simple packet filtering, this is what was tried?

    Test Case :
    ...
  15. Replies
    8
    Views
    2,016

    The || has to be replaced with && as below, ...

    The || has to be replaced with && as below,



    while(gameCh != 1 && gameCh != 2 && gameCh != 3 && gameCh != 4);
  16. Replies
    2
    Views
    847

    When a double value is assigned to an integer...

    When a double value is assigned to an integer variable, the fractional part automatically gets truncated .i.e., only the integer part goes into the variable. (See example below)



    double...
  17. Replies
    3
    Views
    5,126

    Packet Filter Using Unix Sockets

    As a part of my project i have to use UNIX socket programming to discard IP packets coming from a particular IP address.

    So what i did was, I created a socket as follows,



    int sockfd;...
  18. Replies
    2
    Views
    3,177

    great explanation!!!! Thanx a lot.

    great explanation!!!!

    Thanx a lot.
  19. Replies
    2
    Views
    3,177

    Comma Operator

    The sample code below uses comma operator,



    #include <stdio.h>

    int inc(int i)
    {
    return ++i;
    }
  20. Thread: Phone Book

    by doraiashok
    Replies
    7
    Views
    2,080

    Please Indent the code next time when you upload,...

    Please Indent the code next time when you upload,

    some of the errors are

    1) character variable cannot be initialized to NULL pointer



    s.homec = '\0'; // NULL is used only to initialize...
  21. Replies
    5
    Views
    2,875

    It is always better to print the error messages...

    It is always better to print the error messages to error output as in the code below,



    if( in == NULL)
    {
    fprintf(stderr,"\nUnable to open the source file.");
    return 1;
    }
  22. Replies
    3
    Views
    970

    There are 3 logical errors in the code, 1) ...

    There are 3 logical errors in the code,

    1) Variables QL, QD, QP, QS, QO are to be initialized to 0, since you are using it in the later part of the program.

    2) I don't understand the...
  23. Replies
    6
    Views
    1,565

    sorry about that 'lengthystring[i]' missing

    sorry about that 'lengthystring[i]' missing
  24. Replies
    6
    Views
    1,565

    As prelude has already explained in the other...

    As prelude has already explained in the other thread, you can use scanf as follows,



    for(i=0;i<=5;i++)
    {
    scanf(" %[^\n]",lengthystring[i])
    }
Results 1 to 24 of 24