General C++ Programming - June 2012

Trivial use of polymorphism?
 
I am working on a shooter game in which several types of shot motions will be used. It seems like a misuse of polymorphism to create a variety of classes for sh...
[4 replies] Last: Me neither, xP. Suppose that you want other objects to move too. That ... (by ne555)
multi threading
 
hi all i want to do part of project with multi threading in c++ but dont know ,how pass multi argument to thread in win 32 for example in this code myhan...
[6 replies] Last: unsigned id; HANDLE hThread = (HANDLE)_beginthreadex(0, 0, ThreadFunc... (by kbw)
Remove characters from string
 
I want to remove the initial and final " character from my string: string str("\"aaaa\""); // "aaaa" How can I do using standard c++ or boost library? Than...
[3 replies] Last: @GliderKite You are wrong. Your task as you described it is to delete... (by vlad from moscow)
algorithm order
 
Hello sorry.Can you help me determine the order of the alggorithm T(n) = T(n-1) + (n-1)/n(n + 1) ? Thanks in advance!
[6 replies] Last: You could solve the recurrence, and get the result in constant time. (... (by ne555)
Detecting pressed keys
 
Hi, I'm working on a small labyrinth game (you got a hero, you move around and kill monsters) and I was wondering if there is a way besides Win API(the only thi...
[4 replies] Last: If you want to do it with out pressing enter, you could use GetAsyncKe... (by Callum5042)
Opinions on multiple statements per line?
 
Just curious as to people's opinions on writing multiple statements on the same line. Some examples of what I've seen: using std::vector; using std::st...
[4 replies] Last: Just curious as to people's opinions on writing multiple statements o... (by kbw)
Dev c++ "microsoft error" with arrays?
 
My code is succesfully compiled, but then i run the program it throws microsoft error "don't send" button. What i'm doing wrong? #include <iostream> #inclu...
[3 replies] Last: I am sorry but I do not understand what it is doing. (by vlad from moscow)
setw() not working for me
 
I'm using Dev C++ ver 4.9.9.2 This is the code: #include<iostream> #include<iomanip> int main() { setw(5); std::cout << "-" << 1 << "-"; std::ci...
[3 replies] Last: Thanks so much for the input! Because that's the syntax given in the V... (by padfoots)
Using stringstream to name a variable
 
I am going to be working on a CUDA gpu based chess engine, and I will be using an unknown number of cpu and gpu threads, possibly hundreds or thousands of threa...
[3 replies] Last: What i was doing was creating object based CPU threads and my focus wa... (by JakeIsBoss)
gcc 4.7 with C::B
 
I've been doing a little research online about the best way to get C::B running with gcc 4.7, but I'm feeling more than a little overwhelmed at the moment. I...
[2 replies] Last: You're right. My problem was two-fold. Firstly, I was overthinking th... (by atropos)
by revin
Project Euler #50
 
http://projecteuler.net/problem=50 Hi, I'm trying to solve the problem on the above pg I'm using two set of codes I'm using this one to generate Prime Nu...
[1 reply] : Well, this is a very messy and unoptimal code, but I won't elaborate o... (by KRAkatau)
Template Class, Multiple types in main
 
I need main.cpp to test the int type which is already implemented, and then double, and string. Now I have tested it by changing int to double for s1, but how c...
[1 reply] : You could move that stuff into a templated test function and pass the ... (by kbw)
by NuTone
WSAEFAULT on "connect" for (network-)client
 
Hi guys, I'm not too familiar with network programming. In order to get more experience, I've been trying to establish a client-server connection. As for the...
[2 replies] Last: Thanks for pointing that out. I've been wondering what possibly could'... (by NuTone)
Template Class Help
 
I am attempting to convert a class to a template class, I am confused how to call from the declaration of the template class from the function. If anyone has so...
[7 replies] Last: Not sure why i had the virtual in there but I got rid of that. Also I ... (by rmartin20)
Class in a struct
 
Hi, I have two questions. 1. I know it is possible to declare class objects in structs. But is it ethical to do that from design point of view? 2. In my sce...
[3 replies] Last: Agree with Peter87. Setting each member individually seems not so 'coo... (by iamlms)
by Scoobs
Scheduling Program
 
Just a little background... I started learning C++ two years ago and I stopped coding about a year ago. I am picking it back up again and decided to create a sc...
[1 reply] : Okay, a few things: 1) Indentation. You can of course indent however... (by rollie)
C/C++ is an optimal choice
 
For developing software for embedded systems, C/C++ is an optimal choice. Yes or NO? Please any one tell me the logic reasons.........
[2 replies] Last: @mfawadsaleem You should have a look at TR18015 http://www.open-std.o... (by JLBorges)
Help please... PlaySound Win 7
 
Hi, Can anyone help with a problem I've got with PlaySound running on Windows 7. I'm porting some software from XP to Win 7 and the application is meant to p...
[no replies]
by xnov
error in dynamic memory using struct
 
hi all, i'm trying to make a array dynamically using new the struct and the code that call the struct aren given here: struct Vector3 { double x; ...
[4 replies] Last: thank.. it was a silly mistake, i didnt calculate it right (by xnov)
Please help me...
 
I have implemented the code for Understanding Background Mixture Models for Foreground Segmentation. I got this as program output http://i697.photobucket.com...
[no replies]
June 2012 Pages: 123... 33
  Archived months: [may2012] [jul2012]

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