General C++ Programming - February 2022 (Page 2)

by SSDEEZ
Array of Linked Lists
 
I've made a class defining a list. I know STL has a list function but I went ahead and coded the who...
[7 replies] Last: The code looks to be "over-engineered" -- as well as missing several c... (by deleted account xyzzy)
by frek
packaged_task and future
 
In the code example below, everything "looks" fine, but why do I get a runtime Debug error: abort...
[2 replies] Last: Thank you. :) I don't know why I'd forgot to call join there! Both jo... (by frek)
by Cplusc
build a solution after cloning from github
 
I cloned the palabos repository using "git clone https://github.com/gladk/palabos.git" into the work...
[2 replies] Last: Thanks for your answer. After many try and errores I used Ubuntu and g... (by Cplusc)
C++ class inheritance, Visual Studio and modules
 
It looks like I found a bug in Visual Studio how it processes module code. Here's some non-module c...
[5 replies] Last: Add the default ctor and comment out the using statement in the modul... (by seeplus)
Rock, Paper, Scissors using enums and functions help!!
 
the requirements for this assignment are to use enums and functions and an option to play again. im ...
[3 replies] Last: Perhaps something like: #include <iostream> #include <random> #incl... (by seeplus)
by narada
trouble with boundary values for number guessing program
 
The assignment is to write a program that will correctly guess a generated number between 1 and 100....
[2 replies] Last: Small point but if number_generator() was called multiple times (say i... (by seeplus)
How to allow the user to "roll the dice" x times and save those values into a 2D array
 
Hey guys, I am currently working on tweaking a project for my class where we have to allow the user...
[7 replies] Last: I needed to save the output so that I could plug it into a separate fu... (by NopeNoRoboHere)
by frek
Meta Functions
 
As far as I know, metaprogramming is used in C++ for better performance. I tired to test and figure ...
[16 replies] Last: A metaprogram is just a program whose input or output is another compu... (by mbozzi)
by frek
Condition(al) variable
 
What happens in this piece of code? #include <iostream> #include <string> #include <thread> #inclu...
[11 replies] Last: If by any coincidence, the operating system decides to give the worke... (by helios)
JSonCpp - create a JSON file in C++
 
I have been tasked with creating functionality in C++(running on Linux) to create a JSON file. I ha...
[3 replies] Last: nlohmann's json library can be used as a single #include (json.hpp). h... (by Ganado)
C++20, std::format, address of variables and Visual Studio (1,2)
 
Following on from here: http://www.cplusplus.com/forum/lounge/282147/ to https://stackoverflow.com/q...
[25 replies] Last: Yes, I know. That is the sole reference I can find, online. (And I t... (by deleted account xyzzy)
Why is my code reading the last Line Twice
 
This program that i created is working, but it is reading the last line twice. Idk what I did wrong....
[4 replies] Last: If you're been told to use .good() within a loop (bad idea), then you ... (by seeplus)
cassert and templates
 
In Visual Studio, code that compiles outside an assert, does not compile inside an assert. static...
[2 replies] Last: assert is a function-like macro. Macros are expanded during the prepro... (by Peter87)
by SSDEEZ
fully iterating before termination
 
I want this code to keep iterating and check the whole string before terminating the while loop i ...
[11 replies] Last: Take a look at the any_suit_contains_full_run and amend it for your pu... (by Ganado)
by Cplusc
Mpi 32 and 64 platform.
 
I have a vector or vector of type double and a vector of vector of size_t. I'm sending these vectors...
[9 replies] Last: If you are using Visual Studio then you are presumably using the cl.ex... (by lastchance)
Activity using switch case
 
write a program that can compute the grades of the students from pre-mid, midterm, pre-final, final ...
[11 replies] Last: #include <iostream> #include <initializer_list> int main() { doubl... (by seeplus)
by Adam87
Casting a structure to another
 
Hi, I have a structure that is allocated by malloc My first structure struct TEST_STRUCT { int I...
[8 replies] Last: My understanding is that you want to reinterpret a chunk of memory th... (by Adam87)
Is it possible to not define the size of a 2d array at the beginning?
 
I want to import coordinates from a csv file and i want to store those data in a 2d array or maybe v...
[11 replies] Last: #include <iostream> #include <fstream> #include <string> #include <al... (by lastchance)
by frek
Bits manipulation
 
The size of this class is supposed to be 4 bytes: #include <iostream> struct PPN { // R6000 Physi...
[17 replies] Last: @Ganado Cool. Thanks for that :+) ThingsLearnt++; (by TheIdeasMan)
C++20 - import vs. #include
 
I made a somewhat off-hand comment here, http://www.cplusplus.com/forum/general/282156/ , about imp...
[11 replies] Last: I must modify somewhat my earlier expressed opinion about the "Beginni... (by deleted account xyzzy)
February 2022 Pages: 12345
  Archived months: [jan2022] [mar2022]

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