General C++ Programming - February 2012 (Page 42)

Help with formatting?
 
I can't seem to make the emp. no. employee counter appear in its proper position.I have been trying endlessly now. any help would be appreciated: #include...
[2 replies] Last: Thanks vin! That totally worked. (by znerich)
BinarySearch List
 
Hey, I'm trying to search a List for a substring, but even if it does exist the result is coming out as negative (not present) using the BinarySearch. The ide...
[4 replies] Last: I managed to fix my problem in the end by using a Dictionary and split... (by ahoysailor)
Time comparison between delete and assignment
 
I was wondering how the time taken to free allocated memory compared to an assignment command. In other words, which of these two would result in the mutex b...
[3 replies] Last: Thanks Galik, you're right there is no point setting tempData to zero.... (by The Palm Tree Magician)
by LB
Is this a pointer to a function pointer?
 
I know that void(*)() is a pointer to a function that returns nothing and takes no parameters, but what is void(**)()? Is it a pointer to a pointer to a functio...
[4 replies] Last: Oh! So this whole time, function prototypes were actually...wow, I nev... (by LB)
Craps Simulator
 
In this program... i am attempting to display odds at 100,1000,10000... the problem that i am having is... calculations are not right. #include <iostr...
[1 reply] : One problem I see, is you are using the variable i, for two different ... (by whitenite1)
I need some enlightenment on const
 
My knowledge of C++ as it pertains to the C++ extension of C is far from pro so I'm always getting tripped up when I try to do anything beyond basics with class...
[3 replies] Last: Const objects/references can only call const member functions. Declar... (by Disch)
Comparing chars -.-
 
Hi I know this is the simplest thing ever but everything I tried failed surprisingly :/ Basically i want an input that is "blue car". And I want a conditi...
[5 replies] Last: Wow that works codingshark thank you very much, kudos. (by codermonkey)
by RickH
Microsoft and Gnu handling of scope operator
 
Hi all. I'm doing some programming in Qt, but it uses Microsoft's compiler. Microsoft and Gnu seem to disagree on what's legal. Below is an example of the pr...
[6 replies] Last: Well, I guess if Comeau says it isn't standard, it isn't standard. ... (by RickH)
Question relating to error C2243
 
What does it mean by this: "Access protection (protected or private) prevented conversion from a pointer to a derived class to a pointer to the base class." ...
[4 replies] Last: And the error was...? (by Zhuge)
by Gldnbr
Maze game movement
 
I'm working on some kind of maze game, I'm not an expert at C++ programming, but with my basic knowledge, I'm able to get something done. What happens in this ...
[3 replies] Last: Oh yeah that's right the break will only exit the y loop not the x one... (by Muckle ewe)
Calculator help
 
hello, im very beginner at C++ and whit about 1 week studying i managed to make a calculator i got visual C++ express 2010. i made my calculator but it ha...
[2 replies] Last: thx :3 (by LordJike)
Timing sorting algorithms
 
Hi, I need to time sorting algorithms that I wrote, I wonder if there is better way to go more accurate like 2 decimal places, this is what I have so far. #i...
[4 replies] Last: Sorry about getting the names wrong. It's been a while since I pulled ... (by roberts)
Member function pointer problem
 
Hi, everybody ! I was learning some new concepts in C++ today and heard about, yet not really understood completely, delegates . After this I tried to imp...
[16 replies] Last: Did you really tried to compile it? It compile fine in my VC++ 2008 wi... (by aquaz)
ifstream assistance
 
Hi, I have ten values stored in a text like so: 16 4 18 9 18 0 15 12 0 13 called randomData10.txt I want to be able to read from this file and store these da...
[3 replies] Last: No need for value , since you can just extract the value into insert... (by Wazzak)
Disabling scientific notation in streams
 
I looked at the format flags for streams but I can't get them to do what I want. The default behavior works fine except when the numbers are very small. Here is...
[1 reply] : It isn't possible to make very small numbers output as decimals and no... (by LB)
pointers reseting
 
I am learning how to use linked lists. When I move from one member function to another the pointers reset to NULL. I thought that having the pointers be globa...
[2 replies] Last: I first noticed the problem when I ran this section case 1: a.fillNod... (by plageiusdarth)
Equation (1,2)
 
I have tried to make a program, which simulates a 12 sided dice. This I have accomplished. Now I have to calculate the probabillities of landing on a single num...
[36 replies] Last: As Athar has said there is actually plenty of headroom for calculating... (by mik2718)
outputting array as string
 
Hi, I want to output array elements in a string and store to a text file, but it's outputting weird symbols #include <string> #include <iostream> #include <f...
[1 reply] : You can't append an integer to a string with +=: sortedList+=list ; ... (by abellia)
pleaseeee help me for reading a file
 
i write a program in my program i have a class that name is employee and i have an array of my class that name is employees in my class i have some char var...
[3 replies] Last: Why are you using an XML file? Reading and writing an XML file is not... (by roberts)
by Tatipu
How do I save values from a class? And overload operators?
 
I have this: Class class Rational { public: int fraction(){//default to do 0/1 auto numerator = 0; denominator = 1;} int fraction(int...
[1 reply] : You don't define default ctor, copy ctor and assignment operator so de... (by eypros)
February 2012 Pages: 1... 40414243
  Archived months: [jan2012] [mar2012]

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