1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Buble Sort on Data Members of Pointer Pointing towards array of objects

Discussion in 'C' started by aliarshad91, Apr 2, 2011.

  1. aliarshad91

    aliarshad91 New Member

    Joined:
    Apr 2, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi!
    I am Facing Problem to bubble sort in a "pointer pointing towards arrays of object of a class". I took this array dynamically. Please Someone can help me. Here is the code:

    Code:
    void sort(Book *ptr)
    {
        class Book *temp;
        int opt;
        while(1)
        {
            printf("Select from Sorting\n1.\tBy ISBN\n2.\tBy Title\n3.\tBy Author\nEnter Option Here ");
            opt=getche();
            printf("\n");
            switch(opt-48)
            {
                case 1:
                    for(int cont=0; cont<=contMain; cont++)
                    {
                        for(int sCont=0; sCont<=cont; sCont++)
                        {
                            int isbn1=
                            if()
                            {
                                temp=ptr+sCont;
    
                            }
                        }
                    }
                    break;
                case 2:
                    
                    break;
                case 3:
                    
                    break;
                default:
                    printf("Invalid Option\n");
                    continue;
            }
            break;
        }
    }
     

Share This Page