Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 24th, 2004, 11:52 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
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



Reply With Quote
  #2 (permalink)  
Old August 26th, 2004, 12:07 PM
Registered User
 
Join Date: Aug 2004
Location: , , .
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.

Reply With Quote
  #3 (permalink)  
Old August 26th, 2004, 05:56 PM
Authorized User
 
Join Date: Jan 2004
Location: , , .
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);
    }



Reply With Quote
  #4 (permalink)  
Old August 26th, 2004, 05:59 PM
Authorized User
 
Join Date: Jan 2004
Location: , , .
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

Reply With Quote
  #5 (permalink)  
Old August 27th, 2004, 01:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
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.
Reply With Quote
  #6 (permalink)  
Old August 27th, 2004, 02:56 AM
Authorized User
 
Join Date: Aug 2004
Location: , , .
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.

Reply With Quote
  #7 (permalink)  
Old August 27th, 2004, 12:51 PM
Registered User
 
Join Date: Aug 2004
Location: , , .
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.

Reply With Quote
  #8 (permalink)  
Old August 31st, 2004, 07:51 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off




All times are GMT -4. The time now is 10:17 AM.


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