General C++ Programming - August 2016 (Page 9)

Recursive BST Destructor
 
Hey guys, I'm trying to implement a binary search tree. I'm having an issue with the destructor, which calls another function to kick off the recursive deletio...
[3 replies] Last: WOW. Missing the scope resolution for the DESTROY function. LIne 46 of... (by edge6768)
by Willir
Need help with Petrol Station Program
 
The problem I am having is that I am finding it difficult to output Amount Dispensed & Total Cost in the customer receipt. Is there a way I can cout the output ...
[15 replies] Last: You sorted the issue out? I'm having a very similar issue with mine, t... (by Browny13)
by np1984
assign memory using new
 
I assign memory to array of pointer as shown in code snippet below: #include <iostream> using namespace std; #pragma pack(1) int main() { int (*p) ;...
[5 replies] Last: Thanks a lot for the explanation. I got it. (by np1984)
by fenggg
Hi ppl , i having problem caculating the total monthly expenses , anyone mind help mi out with this ?
 
#include <iostream> #include <fstream> #include <cstring> #include <stdlib.h> using namespace std; int main() { double total; int choice; ...
[15 replies] Last: how u gonna do that You progressively add the relevant item as you p... (by closed account 48T7M4Gy)
These lines are reading a long loop
 
I want to read a line (record) of a CSV file. And so as to increase accuracy of hitting the correct record and then adding some information if a record is found...
[2 replies] Last: Just wondering is the search on all these terms redundant? Guessing (b... (by TheIdeasMan)
whats wrong with this code? run-time error
 
Hi Twilight zone on review here...what am I doing wrong? Compiles fine, but throws run-time error (has to closed). Want to assign 7 to ptr... #include...
[14 replies] Last: I got it, thx *p_ptr points to allocated memory that has no name... (by technologist)
by Nico
How to make a thread safe DLL?
 
Hello, I am creating a DLL and I would like the application that uses it to be able to use the same instance of my DLL with multiple threads simultaneously....
[7 replies] Last: Hello, I think I see what you did there (took me a while). So I chec... (by Nico)
Adding to a map of unique pointers
 
Hi, I am trying to convert my program to use smart pointers but am having trouble creating a map of unique pointers. The map contains sf::image and uses the fi...
[4 replies] Last: Thanks for clearing that up. I should be able to finish converting my ... (by asterisk nullptr)
float Nan
 
how to treat a flaot as Nan? method1: float x; if(x!=x){"x is a Nan"} method2: float x; if((uint32*)(x)&0x7FFFFFFF > 0x7F000000){"x is a Nan"} Why ...
[1 reply] : std::isnan is better: http://www.cplusplus.com/reference/cmath/isna... (by Cubbi)
return *this
 
*this at the end of a function snippet: return (*this); I read that this is returning the class pointed to by "this". My question is how to use the retur...
[4 replies] Last: Thx, that worked fine! Going just a little deeper, what does returnin... (by MikeyBoy)
by taha24
logic gates functions
 
this a four logic gate contains the logic : AND, OR and NOT, and it suppose to take four in put and divide them into to numbers and add them together like this ...
[1 reply] : http://www.cplusplus.com/forum/beginner/195539/ (by closed account 48T7M4Gy)
Understanding Massif Memory Usage Measurements
 
I've recently been attempting the problems on CodeEval.com, where solutions are rated on execution time and maximum memory usage. However, I've found the memory...
[no replies]
assign values to struct string[2]
 
I have googled and have not found anything relating to this, or am just looking for the wrong thing. I have a struct enum LANG_ID_TYPE { FIRSTLANG,...
[2 replies] Last: sorry. the problem is that when t changes from 0 to 1 and I do a watch... (by jwalpole)
Kalman filter, measurements and estimation
 
Hello, I am using a Kalman filter with a PI controller. The goal is to control a mirror to stabilize the position of a laser spot: I am sending a disturbanc...
[no replies]
Physics engine
 
Im thinking about trying to write some basic physics engine. Do games have a single physics engine instance that controls all the physics in the game, or are th...
[2 replies] Last: OK ty. So i just have to dispatch worker threads if i need multi threa... (by vastrolorde)
Type of C++ Programming
 
I heard that alot of website/games use C++, but what 'type' of C++ do they use? At all my C++ programs I use the Console Application option and Code::Blocks? Wh...
[2 replies] Last: It might be a little bit surprising that the website/games use the exa... (by liuyang)
Error when compiling
 
Well, I'm doing a code that works like a register machine. You can register a product, inserting the code and the price. Also, you can search a product by inser...
[2 replies] Last: Im pretty sure you accessed memory not belong to you. Issue 1: A very... (by liuyang)
by dailei
Question about stl code
 
I read some codes implementing iterate in STL and I'm puzzled by it's definition :(partly) template <class T,class Ref,class Ptr> struct __iterator { t...
[2 replies] Last: The implementation is sgi-stl ( g++. 2.91.57) I read the code later an... (by dailei)
Sequence Points - Order functions are being called
 
I'm a little confused, I was reading this article here http://stackoverflow.com/questions/3457967/what-belongs-in-an-educational-tool-to-demonstrate-the-unwarr...
[9 replies] Last: @ JLBorges Thanks for your always interesting replies :+) Perhaps w... (by TheIdeasMan)
help
 
hey guys can someone explain to me how can I solve this ,,,,, Write two functions to compute the values of my_cos(x) and my_sin(x) respectively using the follo...
[2 replies] Last: thank you that was helpful really appreciate it .... (by rakan511)
August 2016 Pages: 1... 789101112
  Archived months: [jul2016] [sep2016]

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