General C++ Programming - December 2009 (Page 14)

by mrkhtn
Template function error
 
I've recently been creating a binary search tree for a set but can't get the inorder function to work can someone point out the error and explain why i got it w...
[2 replies] Last: spotted the error, thanks (by mrkhtn)
Taking data from text file and storing in array - running into problems
 
Hey everyone, so I am having a really annoying problem with my code. The goal of it is to be able to read a text file of an unknown length (it's more or less...
[no replies]
I got a compiler error that i cant fix
 
this program works fine in visual studio put i need to make it work in emacs and this is what i have and there are two bugs i have that i cant solve one on line...
[1 reply] : Code tags, PLEASE! http://www.cplusplus.com/articles/firedraco1/ W... (by Zhuge)
by nrose
guessing game
 
im trying to write a recursive function that will never ask user for a number but the program will guess by asking if the number is greater then a number (the u...
[4 replies] Last: Um I don't think this even compiles. int askfor(srand%101) { Read ... (by Zhuge)
Blackjack Program
 
Hi everyone! I am having a lot of problems with my blackjack program that I just created. Unfortunately I cannot get it to run..if someone could help me with...
[7 replies] Last: I have changed this program around. Please refer to my new Blackjack P... (by ohsnap1319)
Blackjack Program errors
 
Hello everyone!! I am currently working on a blackjack program and I have a couple of errors that I do not know how to fix. I have checked online but unfortu...
[5 replies] Last: Ok so I have fixed every error in my program, however after running it... (by ohsnap1319)
delete does not remove objects from the heap in osx?
 
Considering the following code... int* p; p = new int; *p = 42; delete p; cout << *p << endl; ...will still print the value 42 when compiled with g++ ...
[2 replies] Last: Thanks! So I can understand better how memory is used as a program ru... (by gsteurer)
by Capone
C++ StringGrid + Bubble sort
 
Hello. Can I use bubble sort algorithm in my data surikiuos StringGrid when it is not just numbers, but letters? Suppose a text file is scanned StringGrid l...
[1 reply] : Yes. If you're using string from STL (std::string), simply treplace... (by kbw)
unsigned int apperantly being passed as pointer for no reason
 
this is a constructor for a class Prob::Prob() { unsigned int i = 0; //seed generator for latter use srand(std::time(0)); properTime = 0;...
[2 replies] Last: If it were a wrong type being passed as a pointer, the compile error w... (by Ashden)
by Aslan
a small class problem
 
I have a small problem with writing a class. I should do my H.W. which needs to creat a point class, the user have to insert it's 2 coordinates(x,y) for 2 po...
[2 replies] Last: thank you zhuge (by Aslan)
cannot identify error....
 
I'm still on my movie rental program. I don't know what is causing this error. This coding for my customer list and movie list are nearly identical in format....
[2 replies] Last: you forgot: clientele = item; i hear cin >> and cin.getline(... (by herbert1910)
by jboorn
subscript operator overloading in template class
 
Hello - I'm working on a quick replacement for a STL vector (I'm not able to use STL for reasons too long to explain). My template class stores objects in a r...
[2 replies] Last: Ahhh - right. I guess I've spent too much time in higher level langua... (by jboorn)
by bouns
for loops varible declaration problem
 
hi all, me and a friend of mine come across a strange thing(at least for us) when we were trying to do our school assignment Here it is: we have written a p...
[2 replies] Last: VC++ 6.0 is pre-standard. The standard added the rule that the scope o... (by helios)
by NGen
deque::clear Causing CRT Error
 
I currently have a destructor method (not ~classname) for a base class which is to be used by derived classes within their own destructor. During the execution ...
[2 replies] Last: Thanks, I knew there must've been an easier way to initialize the iter... (by NGen)
custom list class read and write functions
 
i have to build a custom list class. everything works fine except my readFrom and WriteTo functions. i can read from the file to a temporary list but im having ...
[1 reply] : bump (by jgelderloos)
programcrashes when I resize array the 2nd time
 
This code is inside the constructor to a class. When I run my program it crashes and this is the output before it does so: no problem here or here right here...
[1 reply] : It looks like you have rows be 1, allocating the 2-d array with only o... (by Zhuge)
The LZSS algorithm
 
Helios told me about a data compression algorithm. The thing is, I'm not really sure what to do. I haven't really gotten very far, and I've been trying to think...
[4 replies] Last: Wow. That's far more than I expected. Thanks :) (by chrisname)
by giro82
E2108 Improper use of typedef 'CMatrix'
 
Hi everyone, I am trying to write a function modulation which return complex matrix. Unfortunately during compilation I get error: [C++ Error] fSTCodi...
[14 replies] Last: complex<double> (by giro82)
Array, What's Wrong
 
#include "stdafx.h" #include <iostream> #include <string> #include <cmath> #include <iomanip> using namespace std; int main () { double totalmo...
[4 replies] Last: Well they're all telling you that the variable you are referencing is ... (by jsmith)
can anyone take a look at my program?
 
I have written code for merging two doubly linked list together. For some reason, it is not compiling. Here is what I have so far : #include<iostream> usi...
[9 replies] Last: Well, if it's actually supposed to do something but it doesn't, then I... (by jsmith)
December 2009 Pages: 1... 1213141516
  Archived months: [nov2009] [jan2010]

This is an archived page. To post a new message, go to the current page.