1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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

    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