General C++ Programming - April 2010 (Page 15)

get positive values from a vector
 
Hello, From the vector {1,2,-3,-4,5} I need to get only the positive values. Is there a way to d...
[1 reply] : http://www.cplusplus.com/reference/algorithm/find_if/ but if you ne... (by imi)
the "This" pointer.
 
I am really not getting what the "This->" pointer does. I have read and re-read my C++ book and I st...
[2 replies] Last: I want to give it a shot! :-D Back in the old days, when there wa... (by imi)
Using OOP with a BST
 
I haven't really implemented yet, but I have a plan to make a program that uses classes to handle a ...
[7 replies] Last: I thought the root of Smalltalk was Simula? (by imi)
Pertaining to .h files.
 
As I'm sure many have before me, I hope I am not asking too simple a question or too common of a que...
[2 replies] Last: Thank you, Disch. Looks like I was trying to over complicate it! A... (by Tristan)
operator* is ambiguous
 
Hey i'm trying to compile this program but it says that operator* is ambiguous. It worked until I ad...
[1 reply] : i resolved the problem, I just had to call the constructor VM... (by valleymannn)
how exactly do you do a binding?
 
sorry if this has been brought up before. I did lots of searching here before I decided to post. Thi...
[1 reply] : Most other languages have an dynamic library that links using C functi... (by Duthomhas)
by gpapa
Arrays
 
1. Consider the following array definition: int values = {4,7,6,8,2}; What does each of the foll...
[2 replies] Last: Since the OP has no questions, I assume its to share fascinating excer... (by maikel)
Writing a library for linux and windows?
 
Hi, perhaps someone can give some links or other info about how should a C++ library be written, so...
[2 replies] Last: Well, thanks... Too general question, sorry. Maybe later I come back h... (by KarlisRepsons)
Polymorphism, virtual
 
Hi, I've got two classes: One and Two. Class One is base class for Two. Both classes have "Run" func...
[2 replies] Last: More accurately the compiler adds a pointer to the virtual method tabl... (by jsmith)
Not writing to file on unObfuscate
 
I have a program thats a user defined integer to each character of a file, and stores it in another ...
[no replies]
*directoryiterator using Boost
 
I'm trying to store the value that the iterator points to in a directory iterator as a string. i...
[no replies]
by NGen
Template Specialization
 
Let's say I have a template class: template <typename Type1, typename Type2> class SomeClass { ...
[2 replies] Last: Alright, thanks. For some reason the term 'partial' completely eluded ... (by NGen)
sorting corresponding arrays
 
Say I have two integer arrays, {a1,a2,...,an} and {b1,b2,...,bn}. Can I sort the first array (in inc...
[5 replies] Last: I came up with a better way to do this: #include <boost/foreach.... (by maikel)
unipolar stepper motor program
 
i have to write a c++ program that should be able to drive a unipolar stepper motor but through an o...
[no replies]
Trying to overload the = operator to do a deep copy
 
I am currently having some issues with overloading the '=' operator to perform a deep copy of a link...
[5 replies] Last: Also, do not name your parameter "list" if you are going to use the en... (by jsmith)
sub class constructor calling its "super constructor"
 
I have a super class and a sub class defined as follow class Super { public: double x; ...
[1 reply] : Base class constructors can only be called via initializer list. (by jsmith)
by fafner
Finding an objects place in an array
 
This is probably a n00b question. I have an object that when initialized takes a randomly selected v...
[3 replies] Last: Ah, thanks! I solved, however, by storing the index in an integer valu... (by fafner)
by wrz234
round up
 
i declare double as double amount,rate = 0.3333; int money = 30; amount = rate * money; pri...
[7 replies] Last: Yes, exactly. It is an interesting problem you had. (I had never he... (by Duthomhas)
Shared library problem
 
Hi all, I don't know if this is really a c++ problem or not but I'm using c++ so I thought it was...
[no replies]
passing whole 1d array to function by call by value(integer)
 
how can i demonstrate this thing I am very new to pointers and have just a bit of knowledge in it......
[2 replies] Last: First, why do you want to pass an array by value? It can be done in o... (by kempofighter)
April 2010 Pages: 1... 1314151617... 24
  Archived months: [mar2010] [may2010]

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