General C++ Programming - October 2008

Need to add an array to this code
 
I need help with this code to : a. Creating an array of employees b. Asking the user how many employees records does he want to enter. c. Modifying the inp...
[1 reply] : If you need a user-sized array, I suggest you dinamic allocation or a ... (by Bazzy)
by eule
toupper problem
 
Hi all! Can somebody tell me, why this code doesn't work? char * CClass::hex2char(char *hexString) { for (unsigned int i=0; i<strlen(hexString); i++) {...
[3 replies] Last: How are you calling hex2char() ? You cannot, for instance, call it ... (by jsmith)
simple question about virtual
 
I'm looking at code with an abstract base class, class IDataStorage { virtual bool storedata(); } with the implemented class class CDataStorageImp...
[2 replies] Last: Once a function is declared virtual in a base class it is always virtu... (by jsmith)
by hamo94
unexplainable error on tic tac toe
 
can someone please help i have been programming tic-tac toe for 2 hours and i can't find the error it unexpectedly terminates itself after the first two turns ...
[7 replies] Last: I played this game, and its looks good, this is in fact is my In Cours... (by Tim Smith)
delete causes Sigabrt... but why?
 
Helo, i have the following problem: my program crashes with sigabrt. I used gdb, and it turns out, that the program dies at a delete. If i am correct, a del...
[3 replies] Last: Yup, raw pointers are evil. Better to use in this case std::auto_pt... (by jsmith)
Counting vowels form a file
 
I am working on a program that will acess a file, and load the data into a string, using the string, compare each cha to a refferance to see if it is a vowel, @...
[3 replies] Last: if (curLetter = 'A') = is the assignment operator, not the co... (by jsmith)
by Sb1
Odd error
 
#include <cstdlib> #include <iostream> using namespace std; class Card { int theSuit, theFace; public: int setSuit (int...
[2 replies] Last: Just tried that. Still isn't working. As it stands now, the variab... (by Sb1)
Access violation reading location 0xbaadf00d
 
This is my initialise method for ObjectButton. void ObjectButton::initialise(IDirect3DDevice9* d3dDevice) { // Create the background textures. HR(D3DXC...
[no replies]
Passing class byVal
 
int text = ObjectCtrl->addObject(&newObject); int ObjectController::addObject(Object* newObject) { objectList.push_back(newObject); return objectL...
[9 replies] Last: If your derived class has pointers (looks like ObjectBackground does) ... (by jsmith)
Template Problem
 
After a quick review of the board, I haven't found any questions like this. Here's my dilemma: I want to write a container class for a group of unique obj...
[9 replies] Last: You were right about std::set. For some reason, I was of the impres... (by jlamothe)
Not sure
 
Is there any reason I shouldn't use the following code I've written? The IDOs are defined in a seperate header. void ObjectController::releaseObject(void* ...
[6 replies] Last: What problems are you having? (I replied to the referenced thread alr... (by jsmith)
push_back while iterating
 
Hi I have a program which gives me an assertion error when tries to push_back some value. #include <iostream> #include <vector> using namespace std; int...
[3 replies] Last: it may look like a lot more code, but it's mostly just a few variable ... (by Mal Reynolds)
Finding duplicates in a single TEXT file
 
Hi, I'm stuck and hope you guys can help me out. I wrote a program to analyse a file. so basically it opens FileA and finds the wanted data with a While ...
[5 replies] Last: ++to zaitas solution, nice way of doing it. (by firedraco)
Working with loops...
 
I'm teaching myself C++ with a book I got and I'm working with loops with multiple branches. My code is an endless loop however. Please help. #include <iostream...
[1 reply] : If you want single chars, go ahead and just cin a char, just know that... (by firedraco)
Display multiple chars without returning new line in c++
 
Hi all , i try to write the tic tac toe game , and i would like to display my checkerboard in the way that , if i enter a X or O char in one case , it will re-d...
[3 replies] Last: Thanks for yours helps, i'll try system("cls"). (by rasx2610)
c++construct timetable
 
i am a newbie in c++ programming.i realli need help!!!tis is the code tat i wrote for constructing timetable.could anybody pls help mi!!!i do nt knw which part ...
[2 replies] Last: You are also prompting the user for two integers, but since you pull i... (by jpeg)
by nkc
How to use float?
 
I want to declare a variable with a float. Do i have to write a f after the value? For example: float wert = 25.56f But this is correct, too: #i...
[3 replies] Last: Suppose you have class C { public: char* operator (unsigned... (by exception)
by vcc
cmath vs math.h
 
I just want to use power function of math library. It do not work with #include <cmath> but it works with #include <math.h>. please explain!. I am using Dev-...
[2 replies] Last: This is actually quite interesting and works differently on Microsoft ... (by guestgulkan)
convert Hexdecimal to Decimal
 
Hi i need help to convert hexdecimal to decimal using C.. i'm stuck... please!! thanks..
[1 reply] : Think about how you would do it 'by hand', then make this your first a... (by Faldrax)
by jrok
password strenght determination
 
hey, i am writing a program that will determine the strengh of any password entered, based on a certain criteria. i have written the code and run it, but the w...
[11 replies] Last: Oh good. I was about to post a table, but if you got it, cool :) (by Timaster)
October 2008 Pages: 123... 11
  Archived months: [sep2008] [nov2008]

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