General C++ Programming - February 2021

by frek
Different sorting on a vector
#include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <locale> st...
[17 replies] Last: @JLBorges std::partition preserves values; it just swaps elements. Go... (by frek)
by VoB
Why is this trivial code leaking memory?
Hi everyone, I'm trying to figure out why the following snippet #include <vector> int main(){ ...
[13 replies] Last: Generally, you only need worry about leaks in code that can be tracked... (by salem c)
how to find out what people celebrated their birthday this year
how to find out what people celebrated their birthday this year, if we have the current month and da...
[1 reply] : Read a pair of y/m/d into variables Apply (by salem c)
by MA2121
Need Assistance fixing this program
Write a program that asks the user to enter an item's wholesale cost and its markup percentage. It ...
[2 replies] Last: When posting, please use code tags so that the code is readable! #i... (by seeplus)
Value keeps resetting once I go back to the menu
I'm having a hard time thinking how can I change my variable after it executes. #include "Regist...
[12 replies] Last: Based upon file data, consider as a start: #include <iostream> #inc... (by seeplus)
"Unresolved external symbol" even when the linker can find the function body
Hello, I'm getting an extremely strange error, I have utility functions declared in a header file an...
[2 replies] Last: I found the issue and fixed it, My issue was that my Utils.cpp file ha... (by icegolem123)
member function already defined or declared in variadic template
I am getting this error: 'Group<std::string &>::Group(T1)': member function already defined or...
[2 replies] Last: Thanks @mbozzi! (by JUANDENT)
trying to finalize this assignment
Trying to finalize this assignment, I had gotten help but I was only given hints regarding where I s...
[2 replies] Last: the assignment details are here, sorry forgot to post it: https://past... (by juicypwner)
C++ programming challenge
Have gotten this far but am lost could use some guidance Am writing to get an output of: My da...
[12 replies] Last: Thanks for clarifying, @ Furry Guy ! Although, I was told that it i... (by agent max)
by YViera
Is there an easier way of sorting this?
Hello, I am trying to figure out an easier way of sorting based on frequency to be specific: "Sort t...
[3 replies] Last: #include <iostream> #include <string> #include <map> #include <set> u... (by lastchance)
Vector and Template
Hello everyone. I am creating a lib. In this lib I need to create a template where the T object (cla...
[1 reply] : As the code is very large, the main function of the code above is in t... (by joaoelson)
by YViera
Getting expression must have class type error as well as invalid types error. (Multithreading)
Hello, I'm getting an error with my program when using maps with pointers. For context, I'm trying t...
[1 reply] : #include <iostream> #include <string> #include <map> using namespace... (by dutch)
by soon45
I am having trouble for this C++ Payroll
I am supposed to take advantage of the arrays by breaking the programs into separate types of units....
[14 replies] Last: Hello soon45, agent max is correct I only showed the input part and... (by Handy Andy)
one or more multiply defined symbols found when using catch2
Hi, I am #including catch.hpp in several source files of a project but I get one or more m...
[3 replies] Last: Catch2 is a header only library where only one of the source files mus... (by JUANDENT)
HTML table with C++
Hi! I'm trying to use C++ to print HTML code for a table to a file, then open it for viewing (in a ...
[11 replies] Last: Thanks @thmm! It was just an experiment really, but that video was a b... (by agent max)
by VoB
Fully qualified name and type alias as return value
I have an header file, for which I want to write the definition of the function not right after the ...
[5 replies] Last: I've just tried to compile their code (with clang 12.0), and I always ... (by VoB)
C++ programming challenge
7. Most Fuel Efficient Car Three cars drive a 500 mile route. Write a program that inputs the ca...
[4 replies] Last: thank you all for the help! i really appreciate it (by jtherudy96)
Padding for BMP files with Dynamic Memory
So the goal of this program is to invert a picture's pixels in a BMP format. I'm not really underst...
[5 replies] Last: The 'if' part needs the same test as the calculation if ((info1... (by dutch)
setprecision not working
Write your question here. #include <iostream> #include <iomanip> using namespace std; i...
[9 replies] Last: Eye-opening! Thanks, @Furry Guy! (by agent max)
std::unique_ptr::get vs std::shared_ptr
Hi. When you use unique_ptr, think about you need the pointer in other space. In other space, t...
[5 replies] Last: I thought I'd point out something about the concept of shared ownershi... (by Niccolo)
February 2021 Pages: 123... 6
  Archived months: [jan2021] [mar2021]

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