General C++ Programming - August 2019 (Page 5)

std::vector increasing peak memory
 
I am failed to understand the memory taken up by vector. Problem skeleton: Consider an vector which is an collection of lists and lists is an collection of p...
[6 replies] Last: Thanks to all for replying. I understood the limitation and the next s... (by bhargavah)
Implementation of BST using templates but error no default constructor available, help??? (1,2)
 
I'm using Visual Studio C++ 2017. When trying to run my codebase, I am having an error that says: "'Packet': no appropriate default constructor available." I...
[22 replies] Last: My IDE/C++ compiler know where to look and it knows that this is a t... (by Niccolo)
How to improve the CPU turns in Tic-Tac-Toe
 
Hi there. I am too improve the strategy of the CPU in my tic-tac-toe game. So far I have got this algorithm for the CPU turns. void TicTacToe::CPU_turns() { ...
[3 replies] Last: TTT is known as a good starting point to learn about these things. it... (by jonnin)
Does '&' operator return r-value?
 
int num = 10; int& ref = num; int* ptr = # int num2 = &ptr; In this code, ref and *ptr are l-values. Then what about '&num'? Is it l-value or r-value...
[3 replies] Last: A prvalue (a "pure" rvalue ). For the expression &num : operan... (by JLBorges)
Checking tile collision with SDL2
 
This is another question that adds to: http://www.cplusplus.com/forum/general/257650/ I've found out how I can detect a spesific tile out from a map based on a...
[3 replies] Last: What works, works. I expect minor issues with integer division, but if... (by Niccolo)
Variadic Macros issue
 
Hey guys, I'm writing a wrapper for std::function which contains the name of std::function as string (for debugging purposes) template<typename ... Args> cla...
[11 replies] Last: Hey JLBorges: thx for your very clear answer. Your were a big help to ... (by JuliusCaesar)
warning at function calc closing brace
 
#include <iostream> using namespace std; double calc(double operand1, double operand2, char oper) { if (oper == '*') return operand1 * operand2; ...
[3 replies] Last: it was not broken, honestly, so long as the operator was in range. no... (by jonnin)
Solve complex equation for unknown
 
Hi all, I am trying to solve an equation for an unknown (all other variables are known). The equation is 35.7 in the link https://nptel.ac.in/courses/1121030...
[2 replies] Last: Write a function pressureRatio41( double p2p1, .... ) that will calc... (by lastchance)
what means ATM, UML and OOD?
 
can anyone explain to me what means ATM, UML and OOD?
[15 replies] Last: ;) both helped me to understand ;) (by Cambalinho)
Question regarding custom "dynamic_cast" implementation
 
I'm not sure if this question should go here or in the beginner forum, but here goes. I was watching a CppCon video that explains a custom "dynamic_cast" impl...
[3 replies] Last: You have all the central points. (by Niccolo)
Make an input dynamic
 
I was curious to know that how can I make my code dynamic like when a user gives some input like 'switch on TV' then it will not be limited to that string but i...
[3 replies] Last: Having a computer parse English is incredibly complex to do right... I... (by Ganado)
Need help with memory address
 
Hi guys, What data type is used to hold the memory address stored in the pointer variable?
[9 replies] Last: Pointers, like ints and chars, are integer values. I think more prec... (by Cubbi)
[SOLVED - my bad]crash with std::vector in c++14
 
I just updated a project to use C++14 (in Xcode), and code I had working fine before crashes now. I have a class like this: struct ControlRecord { int con...
[8 replies] Last: I found the problem. I had split my code into two versions, because I ... (by hamoon1)
how get random values?
 
i have these function for get a random values: #include <iostream> #include <conio.h> #include <string> #include <windows.h> #include <time.h> using na...
[15 replies] Last: thank you so much for all to all (by Cambalinho)
TGUI widget
 
How can I insert an image from my file into a button in tgui?? Thanks..
[1 reply] : Have you considered asking over at any of the TGUI forums? https://tgu... (by Duthomhas)
The creation of a game from scratch on a live stream
 
Hello everybody! A little background: after 3.5 years developing a single game (my first commercial game) and releasing it to the PC and PS4, I realized I di...
[3 replies] Last: @Albatross Thanks! Yeah, I'm using the Win32 API for the platform laye... (by DanZaidan)
by frek
C++ embedded
 
Hi all, I'm about to start moving to the filed of embedded C++. I've got good experience in C++ and also some other tools like Qt and QML and stuff near thes...
[9 replies] Last: Great answer jonnin, thanks. :) 1- So when picking a device to progra... (by frek)
Async logger
 
I think i'm satisfied with the result, can anyone please criticise it? Code on GitHub: https://github.com/Sephirothbahamut/Cpp-Async-Logger ______________...
[7 replies] Last: That looks like progress. Now, the critiques. In Logger::~Logger(), ... (by Niccolo)
by ne555
Flex fail on second program
 
create a minimal test case your code is big, ¿what should I look at? > the firts rule in flex file is couldn't find that in your repositories
[4 replies] Last: @ne555 Thought experiment. There exists 10 forums, each with 1 helper... (by salem c)
by bembel
std::async not letting std::cout print to terminal
 
Hi, I tried out the code found here http://www.cplusplus.com/reference/future/future/wait_for/ When I run it on my machine, I don't get any output whatsoev...
[2 replies] Last: Thanks! Fixed it (by bembel)
August 2019 Pages: 1... 3456
  Archived months: [jul2019] [sep2019]

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