473,385 Members | 1,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

debugging

32
hey guys. please i need your help urgently. your help is highly appreciated. actually i have done this code for my assignment but unfortunately i couldn't run, particularly when i press the 1 to add data the program terminated, i wish you guys can do me a little favor by debugging this code and send it to me back.....

thank you



Full code removed per Posting Guidelines
Nov 25 '07 #1
2 952
weaknessforcats
9,208 Expert Mod 8TB
This is non-standard C++:
int n;
string name;
double otheritem [n]; <<<<<<<<<<<<<<<
The size of stack arrays, like otheritem, needs to be known at compile time. The value of n is not known until reun time. As a result I can't even compile your code. It appears you are using g++, and if so, you should be using the
-pedantic switch to disable non-standard language extensions. All compilers have this feature and it's an attempt by the compiler vendor to trap you into using their compiler forever.

Next, your classes have no construcrtors so your data members are garbage.

Next, the menu choice youe enter should be an int and not a string.

Next, all screeen displays should be outside your class member functions. The way things are coded, your screen layout is intertwined with your data. There is now no chance of reusing your class in another program because your screen layout is dragged along with it. You may as well not use a class at all and code everything in main().

Next, none of your class member functions have any arguments. I expect you may not know how to design these member functions so instead your coded the application inside the methods.

That's all I have for now. Please post again when you get this cleaned up.
Nov 25 '07 #2
samimmu
32
This is non-standard C++:


The size of stack arrays, like otheritem, needs to be known at compile time. The value of n is not known until reun time. As a result I can't even compile your code. It appears you are using g++, and if so, you should be using the
-pedantic switch to disable non-standard language extensions. All compilers have this feature and it's an attempt by the compiler vendor to trap you into using their compiler forever.

Next, your classes have no construcrtors so your data members are garbage.

Next, the menu choice youe enter should be an int and not a string.

Next, all screeen displays should be outside your class member functions. The way things are coded, your screen layout is intertwined with your data. There is now no chance of reusing your class in another program because your screen layout is dragged along with it. You may as well not use a class at all and code everything in main().

Next, none of your class member functions have any arguments. I expect you may not know how to design these member functions so instead your coded the application inside the methods.

That's all I have for now. Please post again when you get this cleaned up.
honestly; i am not familiar with classes even my programing experience or skill not really enough good. i just started studying c++. so i tried that out and i wanted to get ur view about it, your view would help me alot


thank you so much for ur reply, i hope u can teach me more to learn about classes
Nov 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
2
by: Andy Fish | last post by:
Hi, Using VS.NET 2003, when I use 'F5' to start debugging my web app, it obviously attaches the IDE to IIS for server debugging. However, it also seems to put IE into some kind of debugging mode...
2
by: Alex Clark | last post by:
Hi All, My system: WinXP Pro, VS.NET 2003, SQL Server Personal Edition. I'm having problems with my old favourite demon, SQL Debugging from within VS.NET. I have to say I've found this...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
6
by: KevinGPO | last post by:
I am currently developing a website in ASP (VBScript) using MS Visual C#.NET IDE. I just create a new "ASP.NET Web Application" and point to my local webserver (IIS) of my website address. Then I...
5
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an...
5
by: =?Utf-8?B?Z2FkeWE=?= | last post by:
I can't get to debug on my local IIS using VStudio.net 2005 Prof. I can on the development server. I get the msg 'the server does not support debugging for asp.net...' I have done the following...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
4
by: =?Utf-8?B?TWlrZSBHYWxl?= | last post by:
VS 2008 initially didn't debug classic ASP. SP1 fixes this in some ways. You can debug if you select the debug option to "Start Without Debugging, then either attach the debugger manually or...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.