General C++ Programming - June 2012 (Page 31)

Constructors/destructors/STL question
 
#include <iostream> #include <vector> class A { public: A(int n) : m_n(n) { } A(const A &a) : m_n(a.m_n) { ++m_copy_ctor_calls; } ~A() { ++m_dtor_...
[4 replies] Last: The minimum (what I got on HP-UX) is 3 and 1: each of push_back(a) is ... (by Cubbi)
by mx760
When to spot uses of modulo operator
 
I understand % (mod) operator returns remainder. The only real use I know when to use it is for determining whether a value is even/odd. I would love to take ad...
[15 replies] Last: What is the purpose of your function? Also, would some kindly explain... (by mx760)
by hb2012
corrigé un code source en opencv
 
slt tout le monde, j'ai une problème au niveau programmation de opencv , j'ai déjà fait une partie du travail demandé , j'ai réalisé une séquence d'imag...
[3 replies] Last: It seems that the you can't load the image, so imgw is a null pointe... (by ne555)
by fadi93
Password protected - security door
 
hey how are you hope all are fine i have here project about Password protected - security door can any one help about this project i need the code i made it by...
[4 replies] Last: thxxx for your comment (by fadi93)
Output freezes compiler, and I don't know why...
 
I am writing a program to calculate the amount of employees needed per hour based on the amount of customers. There must be at least 3 employees at all times, b...
[2 replies] Last: Thank you. I forgot the based-zero (by Cyle Fangmeier)
Looking for right container
 
I need a map-like container in which 1 value could be accessed by multiple keys(usually dozen), which could be dynamically added/removed. Would such thing hurt...
[9 replies] Last: I just wrote this one. Not sure if its best idea, but what do you guys... (by closed account 10oTURfi)
projection
 
The perspective projection formula is something like this: new x = (some number) * x / y + screen -> width some number should be distance to screen. wic...
[no replies]
Parallel Programming??
 
Hello all, I am new to C++ programming. I have encountered a problem where in i am supposed to run a counter when the program reaches a particular point and af...
[7 replies] Last: A process is an instance of an executing program. A thread is part of... (by Moschops)
by Acoyo
RE: Simple Terminal Game C++
 
Hi all this is my first post. I am a beginner in C++ and i came across a topic on this forum called Simple Terminal Game posted by Novak in Jan 2012. I would li...
[1 reply] : I have changed it a little bit. both players now start with 100hp Po... (by Acoyo)
Substrac Fraction C++
 
This is my code, and I don't know what does "this" mean in my code. I just followed the example to do my assignment, and I would like to know how "this" work. ...
[1 reply] : In C++, every class has an implicit pointer to itself. The pointer is ... (by Moschops)
Error debugging
 
HI all, I was compiling a program of inserting an element into a sorted array/getting the index of the insert. My array size was 64 integers. I am getting this...
[2 replies] Last: You get a warning because you use a feature that is only available in ... (by Peter87)
by Kaled
File Transfer via TCP socket Pipe
 
I have a question regarding creating a pipe of sequential sockets to forward a TCP flow over N-Hops path (S - - - > M1 - - - > M2 - - - > M3 - - - > D ). The go...
[8 replies] Last: You can make one application that does everything, however when launch... (by closed account 3TXyhbRD)
by JJJSSS
I'm confused about data structs and classes
 
In my class, we went over this stuff briefly and now that it's time to apply it, I'm completely confused. The book hasn't helped much either. MassData ge...
[4 replies] Last: Yep, looks good. (by closed account 3TXyhbRD)
New Programmer
 
Hey guys im new to all this and im writing a script to output what my age is and if i enter it correctly it will spit out a text line saying Great job yada yada...
[4 replies] Last: It worked like a charm. Much appreciated. Excuse me for not understand... (by Scripter)
math problem
 
I am trying to write a function that rotates a 3d point in two angles. This is what I've got but it don't seem to work. when I rotate the x axis the point ...
[no replies]
by codder
What I'm missing? (vector search)
 
struct s { int a; int b; int c; }; Suppose to have a filled vector vector<s> vec; now let's search an element s _s; _s.a=3; _s.b=5; _s.c=1; and here compile...
[2 replies] Last: no what I should put inside? Edit: Ok i understood Thanks :) (by codder)
convert int or float to char
 
hi I am using SDL and TTF_RenderText_Solid() to show text in my game. I have an int variable and a float variable that I need to be able to write into my stri...
[5 replies] Last: > I get an error and on the watches panel it says playerCash = <incomp... (by JLBorges)
Dynamic memory Allocation over Variable Length Arrays
 
Hi der!! I have a question to ask in C / C++? Q. While creating larger programs it is beneficial to use Dynamic memory allocation (DMA) or defining variable ...
[1 reply] : C99 variable length arrays are not there in C++. In C++, use std::ve... (by JLBorges)
by toran
##macro - difference between VC and GC
 
Following code compiles and runs fine in MSVC, but fails in GC. I'll appreciate the help in a)understanding the issue and b)how to make it work for both compile...
[2 replies] Last: Why do you want this macro? To save one line of code? If you must hav... (by JLBorges)
by Cylab
how to read thousand files
 
Dear All Please share your thoughts and ideas!!! I have thousands of files (.txt) which I have to parse and get bits out of them (e.g. 5th bit of each file i...
[6 replies] Last: If you're looking to implementing a cross-platform, lightning fast fil... (by closed account 3hM2Nwbp)
June 2012 Pages: 1... 2930313233
  Archived months: [may2012] [jul2012]

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