Wrox Programmer Forums
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2004, 11:52 AM
Authorized User
 
Join Date: Jan 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default help please..

hello friends.

I am using C++ builder X....and im aeriting a perograms but when i run them pressing F9 i i just get a box of summary of errors and warnings..my question is..how can i view my program...?
my previos compiler was running under DOS.
this one is runnning under windows..but..how can i have an interaction with my program?

thank you



 
Old August 26th, 2004, 12:07 PM
Registered User
 
Join Date: Aug 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In order to run your program, your going to need to fix the errors and probably most of the warning. If you want to post your program and you errors, I will be happy to try and help you.

 
Old August 26th, 2004, 05:56 PM
Authorized User
 
Join Date: Jan 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello......
i dont think that there are errors.....but the problem is that i cant have interaction with my program...anyway..here is the code..:)

#include <iostream.h>
#include <conio.h>

const m = 50;

class ITEMS
    {
        private:


            int itemCode[m];
            float itemPrice[m];
            int count;

        public:
            void CNT (void){ count = 0;}
            void getitem(void);
            void displaySum(void);
            void remove(void);
            void displayItems(void);
    };


        void ITEMS :: getitem(void)
        {

            cout<<"Enter item code:";
             cin>> itemCode[count];
            cout<<"Enter item cost:";
            cin>>itemPrice[count];
            count++;
        }


        void ITEMS :: displaySum(void)
        {
            float sum=0;
            for(int i=0 ; i<count ; i++)
                sum = sum + itemPrice[i];
            cout<<"\n Total Value:"<<sum<<endl;
        }




        void ITEMS :: remove(void)
        {
            int a;
            cout<<" enter item code:";
            cin>>a;
            for(int i=0 ; i<count; i++)
                if (itemCode[i] ==a)
                    itemPrice[i] = 0;
        }



        void ITEMS ::displayItems(void)
        {
            cout<<"\n code price";

            for(int i=0 ; i<count; i++)
            {
                cout<<"\n"<<itemCode[i];
                cout<<" "<<itemPrice[i];
            }
        }




 main()

{
    ITEMS order;
    order.CNT();
    int option;


    do
    {
        cout<<"you can do the following:";
        cout<<"\nenter appropriate number";
        cout<<"\n1 : Add an item";
        cout<<"\n2 : Display total value";
        cout<<"\n3 : Delete an item.";
        cout<<"\n4 : Display all items.";
        cout<<"\n5 : Quit.";
        cout<<"\n what is your option:";
        cin>>option;

        switch(option)
        {
        case 1 : order.getitem();
        break;
        case 2 : order.displaySum();
        break;
        case 3 : order.remove();
        break;
        case 4 : order.displayItems();
        break;
        case 5 : break;
        default: cout<<"Error in input; try again\n";
        }
    }
    while (option!=5);
    }



 
Old August 26th, 2004, 05:59 PM
Authorized User
 
Join Date: Jan 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

oh...so...i tried it and there are no errors...but....how can i run it..?
i tried F9..nothing happens.....i clicked on RUN the program...nothing happened.

thankx

 
Old August 27th, 2004, 01:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Look for a menu called "Run" or "Build" or "Debug" and explore the sub menus when you find one. Also since it an IDE of some kind you are using there must be some sort of inbuild help system that you should consult for a tour of the IDE, settings etc.
 
Old August 27th, 2004, 02:56 AM
Authorized User
 
Join Date: Aug 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello:
the compiler have several thousand cases of warning or error alert machanism and usually assigned ID,different ID mirror different kind of error,and usually the tutorial of the compiler will explain to you the meaning of each error or warning of each id, even though sometime they hard to understand.

 
Old August 27th, 2004, 12:51 PM
Registered User
 
Join Date: Aug 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Im at work right now and am unable to download a compiler. Either tonight or tommorow night, I will launch your program in Dev C++ and see what I can do.

 
Old August 31st, 2004, 07:51 AM
Registered User
 
Join Date: Aug 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have never used C++ BuilderX, but I think it has something to do with how you have your program set up. Make sure that it is set up to run through DOS. I ran it in DevC++(minus the conio.h file and I got an error with const m = 50;) and I got a menu to display in the command prompt.










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.