Hello Everyone so this is my first post, and i have been studying programming in C from like 6 months enrolled in a university.From last three days i am trying to learn windows.h and upto much extent i have got basics from youtube . But now i am stuck in this code where runtime error occurs when user press 'Ok' button. Please help me out in this. Thanks in advance
            double res,x,t1,t2,t3,temp;
            char num[10],t4[20],disp[50],c;
            GetWindowText(box2,num,11);
            ifstream inFile;
            temp=atoi(num);
            inFile.open("product.txt");
            while(!inFile.eof())
            {
                inFile>>x;
                inFile>>t4;
                inFile>>t3;
                inFile>>t2;
                inFile>>t1; 
                cout<<x;
                if(x==temp)
                {
                sprintf(disp,"\tId: %.0lf\t\n\tName: %s\t\n\tSale Price: %.0lf\t\n\tDiscount %.2lf\t\n\tProduct Added to Cart",x,t4,t2,t1);                     
                MessageBox(hwnd2,disp, "Product Info", MB_OK);
                break;
                }
            }
            inFile.close();
