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

Template Class & Vectors
 
Hey, here is what I'm trying to do: template <class T> class ListItem { public: string label; T data; }; ... int populateLi...
[1 reply] : ListItem is a template. vector< ListItem<int> > would work, for ... (by jsmith)
by dbaby7
Calculator
 
Hi guys, Im trying to write a calculator in c++ to improve my skills but I've come across a problem....I read the type of calculation the user wants to perform...
[no replies]
by Alan
Physics
 
I'm working on a small 2D physics engine. I have perfect elastic collision implemented, but I cannot seem to find a formula for the ending angular momentum of t...
[no replies]
Need assistance with overloading operators...AGAIN.
 
EDIT: Program crashes and I can't figure out why. Objects aren't subtracting... I'm getting some weird error with my = operator that I'm attempting to over...
[13 replies] Last: For each element E1 in bag1: For each element E2 in bag2: ... (by jsmith)
by btripp
what next? any ideas
 
Hey all. Ive been programming in C++ for a decent amount of time. Ive been over most of the concepts of object oriented programming. Ive done UML. I know C++...
[7 replies] Last: He has it listed on his profile as a skill, so I should hope so... (by chrisname)
mutual template definition
 
Hello, this code: template <class tB> struct A{ typedef float atype; typedef typename tB::btype typeB; }; template <class tA> struct B{ ty...
[3 replies] Last: That's actually an interesting problem. I can't think of a good way a... (by Disch)
Overloading the += operator isn't working
 
My += operator's acting as if it's...not doing anything. My friend and I can't figure out what the problem is...so I'm resorting to you guys, the CPlusPlus comm...
[7 replies] Last: No no no no no. operator+= must modify its left-hand side. Wha... (by jsmith)
How to make a vector structure globaly ?
 
We are developing a C++ project with 10 cpp files and 3 header files.We are declared array structure of 3 integer varibles globaly in header file and using in s...
[1 reply] : extern std::vector<int> globalVector; in the header file and in an ... (by jsmith)
incrementing letters and symbols
 
Hello. I'm new to C++ and need some help. I need to make a program that basically would output this: a b c ... aaa aab aac ... aaz aa0 aa1 ... aa9 ...
[6 replies] Last: Wow, that looks incredibly complicated. I can't see how that contribu... (by kbw)
Copy constructors - making deep copies
 
EDIT : Nevermind. I got it. ----- I'm sorry for making another topic, but my brain just went kapowie! ; plus I've burned myself out from studying for my...
[11 replies] Last: Yeah, his point was that it was confusing to have that there. IMHO, c... (by firedraco)
how to scope a non-member function?
 
Okay, this is pretty simple but for some reason is escaping me today. I have a class which wraps some non-class library functions, and I want a couple of the m...
[4 replies] Last: Thank you, I guess I can mark this as solved. (by TWRackers)
by tanago
making number repeater program
 
hey guys i've been trying so far to make a "number repeating" program in c++. for example i "cin" the number 12 and i want the output to be 12121212 input:8 ...
[9 replies] Last: Hi I would use an ostringstream, append with "<< n" as long as the ... (by maikel)
MinGW not linking against dll
 
The dll is MinGW compiled as well, so all should be going fine... here's the make file line in question. and the error I'm getting... g++ src\test.o bi0...
[2 replies] Last: mmhm I am. UPDATE: After fighting with it for two days A thought oc... (by Seraphimsan)
by enic
std::set::find won't work...
 
class Mng { public: Mng(); //... //m_Bs may be changed by memberfunctions of the class //m_update may only be changed by Mng::Update and ini...
[1 reply] : There isn't enough information there to diagnose your problem, however... (by jsmith)
header files
 
We just started learning function in my college class I have already used them so it not that big of a deal to me but he said something about header files and I...
[1 reply] : This might help: http://cplusplus.com/forum/articles/10627/ (by Disch)
seperating strings
 
Hi I am nnew to c++ and have a simple question. say i have a string of str = "hello world 23.133"; I wish to store a string values to str1 = "hello"; str2 =...
[2 replies] Last: http://www.cplusplus.com/forum/beginner/20630/ Don't double-post. (by Duthomhas)
how to declare 2D vector
 
I want to define a 3x4 2D vector, how can I do it? For 1D vector, I can do std::vector<double> a(3); but for 2D?
[8 replies] Last: It is. (by jsmith)
by Duy3
Assignment prevention?
 
I noticed people put both operator= and dtor member functions in class private section to prevent copy at assignment. For example: http://en.wikipedia.org...
[2 replies] Last: But hiding the destructor means you can't destroy any instance of th... (by jsmith)
Bank application
 
Would need help to get started on a project. The project purpouse is to create a program to simulate a type of banking application. There shall be a menu (mai...
[no replies]
insert and read files form!
 
I need to insert and read Arquier, can anyone help with my code? # Include # Include <malloc.h> # Include # Include <ctype.h> # Include <fstream...
[1 reply] : one more thing you missed #include <iostream> in ur code .. which is v... (by anurupr)
March 2010 Pages: 1... 1516171819... 23
  Archived months: [feb2010] [apr2010]

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