Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   How to Buble Sort on Data Members of Pointer Pointing towards array of objects (http://www.go4expert.com/forums/buble-sort-data-pointer-array-objects-t25403/)

aliarshad91 2Apr2011 09:27

How to Buble Sort on Data Members of Pointer Pointing towards array of objects
 
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;
    }
}



All times are GMT +5.5. The time now is 12:31.