General C++ Programming - April 2012 (Page 25)

Overloading comparison operators
 
I want to overload some comparison operators (<,<=, ==, etc.) and the way I thought of doing it was something as simple as: bool Patient::operator<(const ...
[5 replies] Last: Once you've defined the operator <() and operator ==() , you can im... (by closed account 1yR4jE8b)
Guessing Game
 
Below is the code I've been working on the past few days. It is about the guessing game where the guesser will have to guess a secret number of the player whils...
[no replies]
Linker error
 
In my main function located in its separate file, I have the following call: #include "Heap.h" int main(){ Heap<int> myHeap; myHeap.heapInsert(9); } In my ...
[5 replies] Last: Don't #include cpp files. Just cut and paste the stuff from your Heap.... (by Duthomhas)
Refining my OOP program
 
Hello CPP community, At our course we've been given an assignment to jump-start us on OOP with C++. The assignment details, roughly are as follow: - Crea...
[5 replies] Last: As an update to this post, since my little mission ain't over yet - I ... (by Luponius)
I need help!
 
I'm trying to create classes and put them in a menu. Why isn't this working? #include <iostream> #include <stdlib.h> #include <math.h> using namespace...
[6 replies] Last: Thanks VERY VERY MUCH!! :) (by starbucks)
Sorting 2D arrays
 
Hello everyone, I just came across some problem here, I had to create some 2D array to help holding values for some other array (1D), so they have both the sam...
[no replies]
by josh1
I need a c++ tutor
 
Hi, I would really like to learn c++!
[no replies]
by arooj
Writing Zip codes and cities to sequential access file
 
I was just wondering what I was doing wrong in my program, which is supposed to add records from the user of zip codes and corresponding cities, and then either...
[1 reply] : void displayCity() { while (true) { //declare v... (by blackcoder41)
shutting down the computer
 
guys i need help, i don't know how to write the c++ code(c++ vcl not Visual c++) for switching off the computer/logging off. i need your help fellow Programmers...
[no replies]
i cant run program!!!!!!
 
visual c++ code using namespace System::Diagnostics; Process::Start("Run.bat") the problem is that it cant find the file specified, please help...
[1 reply] : Two issues: It's .NET 1. Is Process::Start() able to run a batch fil... (by coder777)
by Malcom
LOOP
 
PLease LIKE mE
[5 replies] Last: I think that's called sarcasm... (by Caligulaminus)
Random numbers
 
I was reading about std::rand, and it says that there's a bias towards smaller numbers. I'm looking in to doing large scale random number generation, and I need...
[10 replies] Last: Yes, if the modulo is naively applied. Ups - You're right. Anyway, ... (by Caligulaminus)
Delete node from BST - iterative
 
Hello I have write program in c++ which delete node from BST. It work for some level.Mean it wrok well when some nodes are delte but when i delete root node pr...
[no replies]
extern class objects and extern arrays?
 
This might be an OpenGL problem (I suspect it is) and if so I'll ask over at their forums but it might also be a problem I'm having with classes so I'll try her...
[3 replies] Last: If you would like to ensure that a class is instantiated only once, th... (by KRAkatau)
std::vector mem leak question
 
void some_func() { std::vectr<int> vec; int *ptr1 = new ptr(1); int *ptr2 = new ptr(2); vec.push_back(*ptr1); vec.push_pack(*ptr2)...
[7 replies] Last: The only reasons I can think of to put pointers in a vector are polymo... (by Telion)
Word search in multiple files
 
What would be the best way to search for a key word in multiple files? I am having trouble figure out the best structure to use, how to separate one word at a ...
[5 replies] Last: #include <iomanip> #include <sstream> #include <fstream> inline std:... (by JLBorges)
file input/output and arrays
 
....
[5 replies] Last: Due tomorrow huh? (by rollie)
help with arrays please
 
i am taking a basic C++ coding class and this is one of my projects i am having a serious issue with it and i have no one to help. /* This is a hot me...
[5 replies] Last: you need to change the function at line 143 of the program from: vo... (by kingoor)
by Suber
How to put in record numbers for file operations?
 
Hey guys, I'm having a problem with my program. The idea of the program is to have the user use a attendance record for each student. A problem I am having is ...
[no replies]
ERROR: R6010
 
I created a simple program in C++ and allegro with Visual C++ 2010 Express. It works fine; I get no compiler errors. BUT, when I try to run the program I get...
[no replies]
April 2012 Pages: 1... 2324252627... 49
  Archived months: [mar2012] [may2012]

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