No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I'm trying to delete a linked list and Its crashing when i get towards the end of the linked list. [code] void ZapList (NodePtr List) { NodePtr Temp; while(List->Link != NULL) { Temp = List -> Link; //set temp equal to the list pointer List = List -> Link-> Link; … |
|
[code]void DeleteNode (char CharToDelete, NodePtr List, int &CharFound) { NodePtr NodeToBeDeleted; NodePtr Temp = List; if(List->Link == NULL) return; while(Temp->Link != NULL) { if(Temp -> Ch = CharToDelete) { NodeToBeDeleted = Temp->Link; Temp->Link = NodeToBeDeleted -> Link; delete NodeToBeDeleted; CharFound = 1; } else Temp = Temp->Link; } if(CharFound != … |
|
I've worked with making classes, but I've never had to use a class in code that I write, so I'm having a hard time. [CODE]#include <iostream> #include <string.h> #include <iomanip> #include <ctype.h> #include "String2.cpp" using namespace std; const int MAX_WORD_LENGTH = 254; // The type definition below permits much easier … |
|
here is the overloaded function i have. I have to enter a float, for example, .123 or 0.123. if there is many zeros in front, then it will skip them over, and test for a decimal, then count the numbers in the end. and then print them out. [CODE]MyFloat& MyFloat::operator= … |
|
I'm not quite sure how to fix it. I have done the debugger on it, and it seems that it might have something to do with the cin.get() but im not sure. [CODE]void MyFloat::Read() { char ch; int k = 0; cin.get(ch); while( ch == '0' || isspace(ch)) cin.get(ch); if … |
|
[CODE]class MyFloat { private: enum {MAX_DIGITS = 20}; char Number[MAX_DIGITS + 1]; char NumberOfDigits; public: void Write(); friend void AssignValue(MyFloat& X); }; void MyFloat::Write( ) { int i; if(!NumberOfDigits == 0) { cout << "0."; for(i=0; i<NumberOfDigits + 1; i++) cout << int (Number[i]); } else cout << "0.?"; }[/CODE] … |