Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~4K People Reached
Favorite Forums
Favorite Tags
c++ x 10
java x 10
Member Avatar for cppStudent

Hi guys, I'm getting " SingletonMain.C:18: undefined reference to `Singleton<MyClass>::instance()' " compiling error. It doesn't make sense to me because MyClass inherits instance() from Singleton, doesn't it ? If someone could shed some light on it, I will be grateful. SingletonMain.C #include <iostream> #include "Singleton.h" using namespace std; [CODE]class MyClass …

Member Avatar for siddhant3s
0
133
Member Avatar for cppStudent

Hi guys, I just can't figure out how to traverse trough this heap. It's a 4-heap and I'm trying to implement a toString method for it. It should return a string and must be recursive. Like pre-order traversal. I'm lost with it. [CODE=java]public String toString(int index,String out) { int child …

Member Avatar for cppStudent
0
668
Member Avatar for cppStudent

I'm reading Data structures and algorith analysis by Weiss lately. There's just one part that doesn't make sense to me at all. [CODE=java]public class QuadraticProbingHashTable<AnyType> { public QuadraticProbingHashTable() { this(DEFAULT_TABLE_SIZE); } public QuadraticProbingHashTable(int size) { allocateArray(size); makeEmpty(); } public void makeEmpty() { currentSize = 0; for (int i = 0; …

Member Avatar for cppStudent
0
892
Member Avatar for cppStudent

I can't understand why there's a memory leak. Can someone please enlighten me ? [CODE=cpp]#include <fstream> #include <string> #include <iostream> #include <sstream> #include <stdlib.h> #include <math.h> using namespace std; class ChocBar{ public: ChocBar(string name = "Barone",double price =1.20){ name_ = name; price_ = price; } string getName(){ return name_; } …

Member Avatar for Agni
0
85
Member Avatar for cppStudent

Hi! I implemented a Binary search tree, which worked as desired. Then I had to create a new class which inherits from "BinarySearchTree" called "SplayTree". "SplayTree" has only one method called "contain" which overrides the inherited "contain". The new "contain" will return a boolean. If the object is found in …

Member Avatar for cppStudent
0
114
Member Avatar for cppStudent

I'm trying to write a stack implementation that makes use of a single link list. The new Stack implementation can inherit from stackADT which I previously used with an array opposed to the link list I want to make use of now. Here is the stackADT [CODE]#include "StackADT.h" StackADT::StackADT() : …

Member Avatar for jencas
0
102
Member Avatar for cppStudent

Hi Can someone please help me figure out how to find the parent of a node? Here is the closest I got to something that works. It finds the parent and prints it out "parent: x" but it doesn't send the parent node back ? Any help would be appreciated. …

Member Avatar for quuba
0
1K
Member Avatar for cppStudent

Hi This whole pointer thing is getting the better of me. first i have a call to method "convertToCString" in my main: [CODE]int value = 21; char* cstr = NULL convertToCString(value, &cstr); printf("\"%s\"\n". &cstr); cstr = NULL delete cstr;[/CODE] the method looks like this [CODE]bool convertToCString(int& refConstInt, char** ptrtoCharPtr) { …

Member Avatar for Salem
0
86
Member Avatar for cppStudent

Hi [CODE]int** numberLists = new int*[count];[/CODE] I'm having difficulties understanding this line of code, I've just started programming in c++. I think I got the basics of pointers but I can't find any helpful "enough" info about arrays of pointers. I understand that an array of pointers to integers is …

Member Avatar for death_oclock
0
141