General C++ Programming - October 2011 (Page 17)

question on lists in C++
 
Hi-- I am having trouble creating a list in C++ where each element of the list is an object of class credit. Looks to me like the program is having trouble wit...
[2 replies] Last: Thanks a lot. That did it! (by duggarm)
Quick Stacks and Queues Problem
 
We have a project where we create a office simulator where the worker can enter and leaver the office. And documents can be submitted to an inbox stack and late...
[no replies]
Reading Integers From File
 
Alright, I am trying to use isdigit() to determine if the input from the ifstream is an integer. However, this is not working the way it should. My txt file ha...
[no replies]
Header files
 
I was wondering why it's correct to declare a function prototype in the header file and then you put the actually code into a separate .cpp file.
[1 reply] : I read about this a few days ago, but the article itself is slipping m... (by PetKraken)
by foxy16
What's the best angle to hit ?
 
Let’s see if we can find out the optimal angle at which to launch a ball, in order to have it travel the furthest. Write a function find_best_angle that take...
[3 replies] Last: For the in vacuum case (no air resistance) the path followed by the ba... (by mik2718)
Problem opening file
 
I cannot for the life of me figure out why this file will not open up and be processes like it should. The file is located in the same directory as the .cpp fil...
[3 replies] Last: OMG. The file in windows was 3.txt.txt So that is the reason why it w... (by kraigballa)
Erasing element in 2d vector?
 
I want to delete an element in a 2d vector, say in "Field", which is a 4x5 vector I tried Field.erase( ); I know that for a 1d vector, I would just do ...
[2 replies] Last: Also note that the above will only remove the element from Field . ... (by Disch)
HELP!! ... parameter, va_list, va_start (and other macros)
 
So I'm trying to write a function similar to printf. The point of this function is to get each argument (via va_arg macro) from the ... parameter individually a...
[2 replies] Last: You can do one of two things (or more probably lol): 1 - explicitly t... (by ceruleus)
by EKD
convert string to equation
 
I have a string variable that is an equation. I'm trying to evaluate the string to compare compare it to a known integer answer. The only operators in the st...
[no replies]
GUI Design
 
Dear forum folks, I'm making a GUI library for SFML and thus I'll have some design decisions to make. The most important one: To make, or not to make a base...
[9 replies] Last: For inspiration, some documentation about FOX Toolkit : The base wind... (by bartoli)
To nest or not to nest...
 
I'm writing a container class (call it C) and trying to decide whether I want my Iterator and ConstIterator classes to be defined as inner classes of C or stand...
[3 replies] Last: If something is going to be used a lot - I try to give it a short name... (by mik2718)
Returning pointers to struct members
 
Hi, I want to write a class that returns a pointer to any data in an array: class CData { private: struct { void* pVoid; int ...
[1 reply] : if I am doing c or c++ I need to allocate pointers in memory to use th... (by Azagaros)
Operator Overloading
 
Well, I had a problem earlier that "mtbusche" helped me out earlier with, but this is a bit different. Right now, I get a "... must take either zero or one argu...
[2 replies] Last: If you have a member (unary) operator+ then the left hand operand is *... (by mik2718)
Methods for Creating a function that reads digits of any number
 
Here is the RME: //Requires: num >= 0; 0 <= digit <= 9 //Modifies: nothing //Effects: will return true if 'digit' occurs anywhere within 'num' // ...
[2 replies] Last: Excellent! Thanks.. haha easy. (by Bryce Brown)
safe container classes
 
Is there a well-designed stupid-programmer-proof container class library available for C++? BACKGROUND: OK, so I've used the STL for many years. In the S...
[3 replies] Last: where c1 is a set and i2 is an iterator pointing into some OTHER set ... (by ne555)
Doing Something every few milliseconds
 
I'm doing a game, and I want to update the x and y offsets (integers) of my player image every few seconds or so by the hspeed and vspeed. Sort of like: if ...
[4 replies] Last: Some comments, handled in Disch link : On windows at least, you wan't ... (by bartoli)
formatted output
 
I would like to format my output so that it looks like this: Head Movement Tracks traversed 15 - 4 11 4 - 40 ...
[1 reply] : Maybe try using "\t" ('tab') instead. Haven't had any odd behavior wit... (by Gaminic)
Exception Handling Help
 
Well, I have the code, I just don't have a clue how to declare it in the header file because my teacher is confusing. What I mean is how do I make a prototype f...
[4 replies] Last: Well, I mean I replaced it with "std::out_of_range", and it works just... (by H0m3r0w)
OpenGL
 
I'm attempting to draw saturn and I have the sphere but I'm having a little trouble with the ring. I keep getting uninitialized local variables as well. Here is...
[2 replies] Last: Ok got it, wow I did not realize anybody would get back to me this fas... (by Trigger84)
by Pyrius
Automatic ID for class objects
 
I want to have each object of some class have an ID, but I don't want to have to pass in an ID to the constructor whenever I make the object for it. I want to d...
[4 replies] Last: Thanks for the help, it works now. (by Pyrius)
October 2011 Pages: 1... 1516171819... 36
  Archived months: [sep2011] [nov2011]

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