General C++ Programming - March 2010 (Page 23)

Inheritance issue.
 
I have two very different interfaces, A and B that have a single pure virtual function in common. Some objects are inheriting from both A and B. The problem i...
[2 replies] Last: Yep that works, thanks again! (by AlwaysLearning)
12 and 12.5
 
Hello everyone! I am new to this programming world. I recently wrote a program that prints the sum of the series 1 + 1/2 + 1/3 +...+1/n. It works perfectly...
[3 replies] Last: I prefer the latter. Here's an improved version of an answer I gave... (by Duthomhas)
by Dsimm
Variable not declared in this Scope
 
I am working on creating a text based video game for a school project and whenever I try to build and run my program my compiler tells me the string variables i...
[3 replies] Last: OH, Alright thanks that helped a lot (by Dsimm)
pointer problem
 
here is my program. Basically i want to ask the user for a value. then his selected value will replace the value inside the array,the user will have to specify ...
[2 replies] Last: Well I agree with PanGalactic that there is a terminology problem in t... (by kempofighter)
Program flags
 
Hi, I want to have flags in my code. I am trying to do it with enums, for example: enum EStatesFlags { NONE_FLAGS = 0x0, WHITE =...
[1 reply] : use "int" in the functions instead of the enum. And while you are at i... (by imi)
Make files
 
Alright I'm writing my own makefile for the hell of it, problem stands how do I get it to compile a source file to an object file if and only if that source fil...
[2 replies] Last: Thanks, I've never used make before So i wouldn't of known that :D (by Seraphimsan)
Errors while trying to free memory
 
I keep getting Seg Faults because my program tries to free the memory after a function call. Here's whats going on: I have class A that looks like this: c...
[4 replies] Last: Here are a lot of unsaid things. The struct in A is called "list", ... (by imi)
case statement not being read
 
no idea why but for some reason whatever i enter in as a function either s, c, t or x. none of them work, it goes straight to default if i have one, and i not n...
[4 replies] Last: Thank you so much guys :) (by joesworld234)
by imi
Some way to optimize functions without side-effects?
 
Hello, it's about functions without any side effect.. I know, that compiler are allowed to do some optimizations in the creation of return values, which c...
[8 replies] Last: Well, while I couldn't find a compiler switch as I original hoped, the... (by imi)
A good Programming Book or study guide
 
Can anyone advise me on what kind of Book that is really good for c++ programming. I mean with a lot of hands on experience.
[6 replies] Last: Sorry for the late answer, but I use Microsoft c++ (by ahbrahim2)
Register keyword
 
if i have a 2 different functions f1() and f2(), f1 has an optimised variable (using register) and f2 has 500 optimised variables, is it true to say that ...
[5 replies] Last: ok i guess this question is purely academic.. (by pacerier)
fastest bitwise operator
 
well there are 2 questions that i want to ask 1. is it true that the speed of the bitwise operators are Equal, or are there differences (though negligible)...
[5 replies] Last: heys, thanks for the link (by pacerier)
trinary search
 
I'm trying to make a program that uses the trinary search algorithm here is what I have right now. #include <stdio.h> const int SIZE=9; void TSearch(int a...
[2 replies] Last: Actually I finished the program but thanks for trying. (by coolProgramer5)
by Xycose
error: no matching function for call to `getline(char[51], std::string&)'
 
I'm working on an assignment for my computer science class. I was able to use an input file to store data into three separate arrays, and then I realized when I...
[1 reply] : inputFile is a char array: char inputFile ; inFile is your ifstr... (by Disch)
organization function
 
I am supposed to write a program that gets an array then the program sorts the array based on even or odds. For example, when the array {1,4,2,3,5,8,7,6} is pas...
[8 replies] Last: Okay now the program is only outputting 1. I'm not sure why. #incl... (by coolProgramer5)
Prime Number Algorithm
 
I have been given a task to create a program that asks a user to enter a prime number. First the number itself is check to see if it is prime or not. -The w...
[1 reply] : Well, you don't need to check every number, only numbers either above ... (by TyPR124)
Need a function to traverse a linked list
 
I need a function to traverse a linked list. I am writing a program that stores a bunch of nodes in a linked list...I have no Idea how to actually traverse the...
[5 replies] Last: Wow, I was making this much harder than it had to be. Thank you the c... (by kyleg033)
March 2010 Pages: 1... 212223
  Archived months: [feb2010] [apr2010]

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