General C++ Programming - March 2022

Trying to get the head of a variadic template argument fails
 
Hi, I am doing something wrong here: template<typename T, size_t Pos, size_t Size, typename...Tables> struct find_in_tuple; template<typename T, size_t Siz...
[no replies]
by Paul5
Sorting in 2d array
 
#include<iostream> using namespace std; int main( ) { int i, j, k, temp, temp1,rows,cols ; int a ; cout<<"Enter rows:"<<endl; cin>>rows; cout<<"Enter...
[18 replies] Last: BUT you must take care what N represents! Its N^3 (very roughly, kee... (by jonnin)
Recursive use of classes eachother on multiple files
 
Hi guys, I'm not familiar with this form of programming so I need your advice. I have several modules like below and I want one to have access to each other's...
[2 replies] Last: between forward declarations and pointers and inheritance, you can usu... (by jonnin)
Translate an Exiftool command to Exiftool in C++
 
I want to translate an Exfitool terminal command to the Exiftool C++ wrapper code. The command is as follows: exiftool -RawThermalImage -b imageIn.jpg > imag...
[2 replies] Last: Also here https://windowsquestions.com/2022/03/31/translate-exiftool-c... (by salem c)
pixel conversion (1,2)
 
I am trying to solve the problem in this link. Any comments? https://stackoverflow.com/questions/66555206/a-pixel-format-transform-logic-from-32-bit-pixel-t...
[22 replies] Last: Thanks everyone for your valuable comments. I am closing this thread n... (by leo2008)
by wqking
I create a little tool to check self contained headers and redundant #include in C++ code
 
https://github.com/wqking/cpp-header-checker cpp-header-checker is a tool that can check C++ source file that 1. If a C++ header file is self contained. If a...
[no replies]
A programming Assigment Iive been given
 
I was given this as a programming assignment and honestly I am quite lost was hoping someone could help Program Description: You will open an input file “...
[3 replies] Last: As a starter, this will read and display the contents of the file (ass... (by seeplus)
MSP430FR6989 CODE assistance
 
I am trying to write a code that allows an LED to blink 5 times and stop, after pressing a button. I have successfully written a code to make the LED respond ...
[1 reply] : https://www.cplusplus.com/articles/jEywvCM9/ Please format your post f... (by salem c)
by stav
initializer cannot be of abstract type
 
Hello friends, i have the following code: struct Foo { virtual void Pure() = 0; }; template <typename T> struct Bar : Foo { virtual void Pure() override ...
[6 replies] Last: If you need this, consider incorporating a capable debugger into your ... (by mbozzi)
Exited with return code issue
 
I'm very new to coding and am trying to do this assignment where all the non alpha characters must be removed from the input string. So if the input is: -Hel...
[5 replies] Last: Alternatively, you can build a second string and have it replace the o... (by Ganado)
by pixi
Retrieve a cookie using c++
 
Hello, Is it possible to create a cookie using PHP and then retrieve the same cookie using c++ installed on your computer? The cookie's name is known.
[13 replies] Last: @kigar64551 You are certainly right. Security is important. But this ... (by coder777)
The runtime constant declaration
 
How do we have runtime constant declaration/definition ? Apologize I feel neglectful how it is definitively as oppose to compile time constant const ...
[1 reply] : You could think of const as meaning "read-only". void foo(int x) {... (by Peter87)
Overloaded function?
 
Hello, for my code I am trying to run it and make a proper table, but an error pops up saying that my "time=.." line is an overloaded function. Any advice? #...
[4 replies] Last: Why indentation matters! #include<iostream> //Required ... (by salem c)
what wrong is with these comparation?
 
do { for(int y=0; y<ConsoleHeight; y++) { for(int x=0, i=0; x<ConsoleWidth; x++) { if(i<GetLineDot...
[8 replies] Last: > unsigned int *PixelColors = (unsigned int) BufferMemory; I don't und... (by ne555)
BlackJack Project: Skip over unused values in 2D Array
 
Hello, right now I am working on creating a multiplayer blackjack game, and have made a bunch of progress since starting over, however the one problem I am runn...
[3 replies] Last: you can set a block to any value with a vector... (by jonnin)
by Cplusc
MPI_Create_op
 
I am working with two MPI processors and I need to create my own MPI operation and recover the results into a vector which will be of size 4 at the end. Local ...
[12 replies] Last: For (int i=0;i<local2global.size();i++){ global_result +=local_resu... (by Cplusc)
how use VirtualAlloc()?
 
//.......... RECT d; GetClientRect(HWNDConsoleWindow, &d); int ConsoleWidth = d.right - d.left; int ConsoleHeight = d.bottom - d.t...
[4 replies] Last: i review the code and now works: void *BufferMemory; BITMAPINFO B... (by Cambalinho)
delete operator in destructor
 
class MapNode { public: string key; V value; MapNode* next; MapNode(string key, V value) { this->key = key; this->value = value; nex...
[2 replies] Last: How does the delete next works and how it deletes the whole list inst... (by Ganado)
by tonic
c++ threads winsock2
 
Hello Guys, Anyone has a simple example of a Multithreaded Winsock2 server? not the one with select(); and FD_SET. I mean normal Multithreading?! where for eac...
[13 replies] Last: YT might be OK for an intro taster to see what it's all about. But wa... (by salem c)
by frek
Pointers and iterators problems
 
Hi all, Please take a look at this program: #include <iostream> #include <vector> #include <numeric> double accum(double* beg, double* end, double init) // co...
[19 replies] Last: Thank you very much JL. :) (by frek)
March 2022 Pages: 123... 7
  Archived months: [feb2022] [apr2022]

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