General C++ Programming - February 2011

by ASid
Design Question - Choice of container
 
Hello all, I am working on an assignement where i have to collect objects in a container. I will ...
[3 replies] Last: That's quite alright. The fact that you showed enough insight to give... (by jsmith)
new/delete operators on class
 
I am making a shooter game where there will be lots of bullets. I know there is a way to use the ne...
[5 replies] Last: Thanks! Those pages are really helpful. The Flyweight pattern also loo... (by ModShop)
Question about reading from Binary I/O file
 
This code works fine. I don't know what I can do in order to display the entire file. As you can see...
[15 replies] Last: Basically, yes :) (by simeonz)
dynamic functions
 
Hi guys, I want to call a function that returns a function. I can use syntax like float (*GetP...
[3 replies] Last: There is also boost::lambda. The syntax is slightly different. You m... (by jsmith)
Any ideas on how to get an average with a loop
 
working on this problem and not sure whats wrong with my program trying to geting to compute an avg ...
[4 replies] Last: NM fixed it woohoo (by dtw103184)
error: invalid application of 'sizeof' to incomplete type
 
I'm running into an error when trying to update legacy code. Small Portion of Code: if (W...
[4 replies] Last: I understand what went wrong. Thank you. (by ricomoss)
by chess
checking string (1,2)
 
How can I check that string name has at least one char, and has no char other than letters and hyphe...
[23 replies] Last: Thanks, simeonz. No more questions as yet. (by alfa333)
by neil86
pointers to vectors created outwith classes
 
I have set up a piece of code where I am declaring a 2 dimensional vector of ints using the followin...
[2 replies] Last: Now that's a word I'd never seen before (outwith). Google says it mean... (by filipe)
retrun "jumps" up to a line above
 
Hi I have this weird problem in my code. The code looks like this template<typename T> Image<...
[4 replies] Last: OMG, that embarrassing, I should have noticed that. Thank you very... (by r englund)
by picci
Using C++ Macro with arguments into a linked piece of code
 
Hi all, i have a macro that i use to speed up the implementation of Factory classes. For example, t...
[1 reply] : It's impossible to say without seeing the definitions of the macros. (by kbw)
by lacrim
I/O possible
 
#include <modbus.h> void main(int argc, char *argv ){ int device = Mb_open_device("/dev/ttyUSB0...
[4 replies] Last: I'm using an older version of libmodbus actually, so i'm not used to t... (by bartoli)
How to copy bmp 8bit file
 
hi all! I'm trying to: 1. read a bmp grey scale 8 bit file image, and extract data matrix 2. cr...
[4 replies] Last: I have found the problem, it's the palette. In the copy.bmp file ther... (by sirmark)
by nlnvcd
inheritance question
 
class Base { public: virtual bool foo(){ return false; } void something { bool...
[4 replies] Last: Given your code class Base { public: virtual bool foo(){ retur... (by onur)
Problems with char*
 
I have this function that puts characters into a char* until it reaches a empty space or invalid cha...
[1 reply] : C-style strings have to be null terminated (with a '\0' or 0 character... (by Disch)
C++ Homework assignment Movie Recommendation
 
So far i have it right but I must wait to produce the output until after the loop. Inside the loop,...
[10 replies] Last: Thank you so much for your time and help. I finally figured the pr... (by sparcer)
Scanning for input in a char array and popping out
 
Hello everyone, I have a program written where a user inputs several type of OS processes with tim...
[no replies]
Peculiar Memory Usage
 
Is there something going on under-the-hood that I am unaware of? Why does this happen? #includ...
[8 replies] Last: C++ must compile to executable form on numerous platforms (CPUs and op... (by PanGalactic)
optimisation of the program to reduce time of program
 
hi i was wondering if someone can give me some ideas of how to reduce the time it takes for the prog...
[1 reply] : Consider using a std::deque<std::string> to hold the list of words rea... (by jsmith)
by DMEW
Making a timer in C++ using child process
 
I am making a timer for a game in c++. i fork a child process that sleeps for 60 seconds and then se...
[3 replies] Last: You can use non-blocking I/O, or you could use select() on file descri... (by jsmith)
MFC Dialog Based - GUI modification with text file
 
have been given a task to rework a IO GUI. The available 32 Bit have already been prelabelled. B...
[no replies]
February 2011 Pages: 123... 25
  Archived months: [jan2011] [mar2011]

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