17 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for nathan.pavlovsky

Hello programmers! I have been working on STL algorithms for some time now as a beginner, and I started doing an exercise, among which is the task of `use the fill algorithm to fill the entire array of strings named items with "hello"`. My code for this is below: // …

Member Avatar for nathan.pavlovsky
0
1K
Member Avatar for Auroch

Hello funs2code! I have the following problem. I need to count the number of occurrences of a concrete word in a text file. I've tried to count the number of occurrences of each word at first. The following code has no errors but it isn't working! When I type in …

Member Avatar for Auroch
0
361
Member Avatar for Pyler
Member Avatar for Pyler

I'm implementing a generi method that's supposed to traverse a binary tree in PostOrder but when I attempt to use it, the Iterator doesn't work as It should when I attempt to use ot on a Binary Tree, can anyone spot my mistake in the code? Thanks. The method makes …

Member Avatar for iamthwee
0
216
Member Avatar for admiri92
Member Avatar for Moschops
0
249
Member Avatar for Derek_4

I know I am probably over thinking this but I cannot seem to figure this out. I am trying to check if the value is null and if not to continue. /** * */ public Item getItem(String theItem) { Iterator iter = myItems.iterator(); while(iter.hasNext()) { Item anItem = (Item) iter.next(); …

Member Avatar for sebastianedu
0
294
Member Avatar for ktsangop

Hello everyone! I would like your help regarding this: I have a tuple vector which i must iterate through, and accessing the vector data to decide wether to erase or not the current vector element. My code : typedef tuple <int, CString, int, int> pc_data; vector <pc_data> pc_vec; //Assume that …

Member Avatar for ktsangop
0
6K
Member Avatar for FUTURECompEng

I am trying to input an int into the end of a singly linked list. I have already created the code to put a number at the end of the list but when I go to print it out, it only prints out (in my test class) the int that …

Member Avatar for jalpesh_007
0
303
Member Avatar for jalpesh_007

Dear all, I have stuck with one problem. I have taken one Hashmap, Performing some input operation,remove operation on it. So after performing remove operation, i want value of 2 successive key in two different array. Also i want to match 1st key's value with all other keys' value. Like …

Member Avatar for JamesCherrill
-1
1K
Member Avatar for sonicx2218

So my java class is a joke, and we're expected to learn how to do our assignments via the web...I'm a hard worker, but I'm just not good at this. [Assignment pic](http://oi50.tinypic.com/aw3zx2.jpg) There's the assignment image. I think i got how to do the first part with the adding random …

Member Avatar for sonicx2218
0
542
Member Avatar for phummon

Hola code gurus, I’m wondering if there’s a way to use a string to access a specific item in a matrix of int[X]. I have a program which uses enums as iterators to reference a large amount of data. To select an item in the matrix, the user will enter …

Member Avatar for phummon
0
317
Member Avatar for megatron21

I am having hard time understanding what the problem is with my code here. Basically I have a map that contains Key objects as the key, and Block* as the value. The point of this for loop is to print out the values that the key contains on to the …

Member Avatar for megatron21
0
250
Member Avatar for Coffee_Table

I am trying to run what i thought was a pretty basic program to solve a problem concerning strings (besides the point). It turns out that my algorithm works properly but i am stuck on a detail; the following segment of code is the problem: [CODE] int cases; string line; …

Member Avatar for Coffee_Table
0
585
Member Avatar for stemiros

Hi, I have a list of base types which stores multiple derived types. The following code shows a simplified setup. [CODE]#include "Base.h" #include "DerivedA.h" #include "DerivedB.h" #include <iostream> #include <list> void main() { std::list<Base*> base; std::list<Base*> *basePointer = &base; for (int i = 0; i < 10; i++) { basePointer->push_back(new …

Member Avatar for mrinal.s2008
0
2K
Member Avatar for fibbo

Hey, it's me again. Again with a topic that has been covered here but reading through the old threads didnt help me to solve my problem. And I am pretty clueless at the moment. Consider the class passenger_queue with 2 functions, namely: [CODE]int passenger_queue::get_passengers_waiting() const { // Insert your code …

Member Avatar for fibbo
0
7K
Member Avatar for keicola

hi, i'm currently learning C on my own. i explicitly made a binary tree just to see if my postorder procedure works. i have no idea why but at the end of running the program, before it does the last procedure, this appears: [IMG]http://i56.tinypic.com/2nb52xx.jpg[/IMG] everything else works fine. i know …

Member Avatar for keicola
0
168
Member Avatar for lasl0w

Hey all, I'm implementing a hash table for a spell checker and need some assistance on vector const_iterator - at least I think that's where the problem lies. Can anyone assist in diagnosing how to fix these compiler errors? I initially got this error, which i think will come back …

Member Avatar for lasl0w
0
438

The End.