General C++ Programming - February 2010 (Page 11)

Quicksort
 
I have a question about quicksort. From what I've read, the value you pick as your pivot can have an effect on the overall performance of the algorithm. So how ...
[8 replies] Last: Oh god... that one is just annoying. Anyway, I don't think there's ... (by chrisname)
by dab
cin & if, else mix
 
Why does it ignores cin and how make it work ? please help #include <iostream> int main() { using namespace std; char a ; char aa; char aaa; char...
[9 replies] Last: I made it work. I can use as many cin as i want now, including mixing ... (by dab)
Good books for learning algorithm design
 
I would foreword that I am a senior in High School so I do not have a textbook on the matter, nor can I take a class on the subject for another few years. Th...
[7 replies] Last: Oh, it's sort of like GNU. It definitely looks weirder in pseudocode. (by helios)
c++ glut callbacks
 
I'm working on a c++Shell, and I'm using OpenGL as the interface for creating the window and drawing text to screen...yes I know this is circuitous, but I'm for...
[4 replies] Last: heh, I understood what you meant :P, and I fixed it immediately after ... (by Seraphimsan)
class error
 
im getting this funny error ive never seen before. the class is taking objects in an array from another class and storing them in a sub array specificed by the ...
[4 replies] Last: THANK YOU ...... ya i dont know why i had my sublist as an array .... ... (by zachtastic)
Best way to sort a linked list?
 
I know the common algorithms to sort arrays (Insertion, ShellSort, HeapSort, MergeSort, QuickSort), but what is the best way to sort a singly linked list? Wh...
[9 replies] Last: >>> I read that Insertion sort actually works much more efficiently fo... (by luisespinal)
Array in Worksheet Functions STDEV (Excel in C++)
 
Following the guidelines of Duffy (2004) etc., I have been pretty successful in understanding the implementation of drawing charts in and exporting data to exce...
[no replies]
priority queue
 
hi guys. i'm supposed to write a program about priority queue. in this case, i have to read the data from a text file and store it into a queue and sorted it ...
[12 replies] Last: to gratrstone actually i haven't studied about template before, so ... (by nosxlimit)
invalid use of incomplete type (co-dependant classes and forward declaration)
 
Hi All, I just signed up after i found a partial answer here to a problem i'm facing. -I have a class (class A) which has a reference to an event handlin...
[4 replies] Last: Obligatory link: http://cplusplus.com/forum/articles/10627/#msg4967... (by Disch)
Using templates for logic
 
I have a template class that follows different logic paths depending on the class used for the template. I am not sure on how to check if a type is one or the ...
[4 replies] Last: Thanks, didn't know you could do this. (by AlwaysLearning)
compiler dependency of a code
 
Hi, i have a cpp code which is showing no error if I compile it by the command icc. But if I compile it by g++, it is showing errors. I am just confused abo...
[9 replies] Last: Glad to be of help. It is a common confusion. I remember when I was co... (by Duthomhas)
What do you use for error checking?
 
Do you use exceptions, or asserts? Error logs... Looking for a new way to catch errors, currently use assert(). Hoping to find something better.
[1 reply] : A combination of asserts and exceptions. asserts are supposed to ... (by jsmith)
Queue/Stack ADTs with templates.
 
Hi people, First time poster, I have been trying to implement a basic Queue structure using templates. I am using VS2008 and I keep getting LNK2019 whenever I ...
[4 replies] Last: Thanks for the tip (by rustyboy)
template function error
 
template <class T> void Test(T r_t) {} int main() { template void Test<int>(int); return 0; } why the above code shows error ??
[1 reply] : Call the function with Test<int>(10); or similar. (by moorecm)
returning a subclass type object
 
I have a problem in returning the object of subclasses. Here is my code typedef /*what will I put here*/ SetGeneratedBlock(int bGen) { const int BLOCK...
[4 replies] Last: That's why I have this declaration in my function... typedef /*w... (by olredixsis)
by fengxu
cout on both screen and file
 
Defaultly cout will show on the console screen. We can redirect the output to a file by change the streambuf. But, sometimes we would like to see the messag...
[11 replies] Last: sout << "\n" works :) And for "endl", which is a function templat... (by fengxu)
simple loan program not working right
 
i have this assignment due for school to write a simple program to calculate loans. it compiles and runs in dev c ++ but does not in cygwin, which my teacher u...
[4 replies] Last: Line 97 as you have it there doesn't do anything, it's just a value. ... (by Impacatus)
by fengxu
Change a parent class to a derived one
 
For example fstream fsA; fsA.open(file,ios::out); Then fsA is the same as ofstream, which is derived from fstream. My questions is: If I have classMother...
[3 replies] Last: Thanks. I got my code working by pointer and virtual functions. (by fengxu)
by genny
a class that return an array
 
I have problem with an array. I created a class where the result is an array of int. but in the main , I can't show the result of my array. Can someone help ? ...
[10 replies] Last: Thanks for the input kempfighter. I did not how to do it. if you see ... (by genny)
I/O with command prompt.
 
Lets say I'm using a command such as system("ipconfig") on a windows machine, how might I go about taking the information given from using ipconfig and storing ...
[1 reply] : It isn't simple. On Windows, you need to use CreateProcess () alon... (by Duthomhas)
February 2010 Pages: 1... 910111213... 21
  Archived months: [jan2010] [mar2010]

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