General C++ Programming - July 2020

by bibo
Pass member function as a argument
 
typedef bool compF(int, int); typedef priority_queue<int, vector<int>, function<bool(int,int)>> my...
[2 replies] Last: minimum (but far from best) fix is probably to bind your member compar... (by Cubbi)
by bibo
Need of declaring a data member directly inside constructor
 
typedef priority_queue<int, vector<int>, function<bool(int,int)>> mypq_type; class Node { publ...
[1 reply] : to call the constructor of base class and member variables use the ini... (by ne555)
Deleted constructor acts strangely
 
I have the following class: class Foo { public: int blablabla; Foo() = delete; Foo(int x) : b...
[5 replies] Last: I understood finally. Didn't know I could declare a function inside an... (by PSYCHAMERON)
Passing member function as a parameter...
 
I want to pass(from one class to another) a member function as a parameter and then for that member ...
[2 replies] Last: Thank you very much, was pulling my hair out with this. (by LearnsMore)
Read and write REAL scalars from and to file
 
I need to read and write REAL acalars from and to file. Please advise how to correct the following ...
[3 replies] Last: are you writing them as text? You may want more digits, eg %1.15f as... (by jonnin)
Character placement in a grid
 
Hello, how can I place characters other than the @ in the grid without the grid marking every positi...
[12 replies] Last: Hello the two separate functions work as I want. But I have to be able... (by oneidacharisse)
CppCast: TensorFlow
 
Rob and Jason are joined by Andrew Selle from Google. They first discuss Ranges support being added ...
[1 reply] : Don't bother with this trash. The broadcast sounds like unintelligible... (by againtry)
Problem with AABB Collision Resolution
 
AABB Collision Detection is easy. You simply set up the sides of a square or rectangle, and see i...
[4 replies] Last: Thank you doug4, Ganado, and jonnin for all of that information. doug... (by AspiringProgrammer85)
Memory alignment (1,2)
 
So I know that memory alignment to a 1 byte boundary may be used in special circumstances lets say y...
[23 replies] Last: so it could be padding, but it could be a short ( 2 bytes ) or 2(char... (by helios)
Mutiple or conditions
 
Hi, I have three conditions and want to go to the top of loop if any of these conditions is true....
[18 replies] Last: Ah, I thought you were referring to my 2 page calculator code which wo... (by jonnin)
reading input files
 
Hello, suppose i have a test.txt file that contains 1 0 3 2 1 4 3 2 5 and i want this to be t...
[9 replies] Last: #include <iostream> #include <fstream> /* test.txt 1 0 3 2 1 4 ... (by againtry)
Check out Yahtzee
 
Hi all. I had the source code up a few days ago, but took it down when I decided to improve the look...
[6 replies] Last: Hi all. I was hoping to be informed if there were improvements to the ... (by whitenite1)
by RicoJ
Template Function vs Function Template
 
if a function template is template <typename T> void f(T) { puts("master"); } and a template ...
[3 replies] Last: Nice, I searched around and did not find anything about " template fun... (by RicoJ)
writing to a file ( file formats)
 
I'm trying to make a simple steganography like program that will change every 50th byte of an image ...
[8 replies] Last: I always used uncompressed tga, which is similar to above but in stand... (by jonnin)
Passing std::function by value VS by reference
 
I have been thinking about this for some days and haven't been able to get an answer for this. What ...
[4 replies] Last: a nitpick, "// # PASS LAMBDA BY" is misleading; those functions are ta... (by Cubbi)
custom cmd line program in c++
 
Hi I am using zbar for barcode scanning. and I want to execute a commaand in command prompt provide...
[2 replies] Last: windows and dos both support pipes and files too. so system("program... (by jonnin)
Correcting a grid map display
 
Been trying to solve this for hours but has been futile. Below is a reproducible code #includ...
[7 replies] Last: Newbie812, your logic is inside out. You have generic loops and the w... (by dhayden)
by thmm
Safe to ignore this warnings ?
 
I was playing around with modules in VS 2017 CE and got this warnings. Are they safe to ignore ? E...
[5 replies] Last: @Furry Guy, yes I set the project options. The code actually runs fin... (by thmm)
by mehat
Double derivative by c++
 
//How to find the value of 2nd derivative. #include <iostream> #include <cmath> using namespace std;...
[4 replies] Last: And as an alternative to <vector>'s and subject to tidy-up terms can b... (by againtry)
template template : no matching function for call
 
this code compile fine in the old compiler (RAD studio XE4) in version 10.3 i get this error: erro...
[5 replies] Last: Thanks I think you're right. (by Ganado)
July 2020 Pages: 1234
  Archived months: [jun2020]

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