General C++ Programming - March 2021 (Page 3)

by Ganado
I need even numbers in each row using array as a output but its showing me the error ?
 
Please edit you post and use code tags to format your code. [ code][ /code] What is the error?
[3 replies] Last: You don't provide any test data, so this is untested but does compil... (by seeplus)
by thmm
Create and manipulate the Linked List Data Structure in C++
 
Don't do it. C++ has a std::list and std::forward_list. If you have to any search engine will give you countless hits. Also be aware that linked list have a ve...
[2 replies] Last: There is no way to quickly explain it. Have a look at this article: ht... (by thmm)
enable_if fragment not working!!
 
Hi, I have a short code sample using enable_if that does not want to compile. Can somebody take a look at this? I am exhausted and can't find the c...
[6 replies] Last: So the question is whether the programs we're discussing violate the o... (by mbozzi)
by Ganado
I want to save this so I can reference how to use code tags
 
You're passing 'mat' (a single double, despite its name), instead of 'arr' (a 2D array of doubles). When posting code, please use code formatting with [ code]...
[1 reply] : Here's some reading for how to use code tags as well as other tags you... (by George P)
Algorithm shopping: Economic object transfer (lossless compression)
 
This isn't really about C++ but I imagine the fine fellows here are probably my best bet! Proprietary system (some weird SoC) - no ready tools for this Proprie...
[7 replies] Last: OP will have to port the algorithm themselves to the platform, that's ... (by helios)
bad_weak_ptr when using shared_from_this in ctor
 
Hi, When I run the example program below (just a MVP of my actual issue), I get a bad_weak_ptr exception. I'd suppose it has something to do with the fact th...
[2 replies] Last: Thanks! Good point about having no control over the objects allocation... (by Aaron Vienneau)
by sinasb
Derefrencing Null pointer and buffer overrun warnings
 
Hello! I have the following code that works properly most of the time but rarely outputs garbage. I suspect it has something to do with the memory allocation a...
[15 replies] Last: The problem with memory corruption is that the error is usually not wh... (by dhayden)
by frek
Writing and reading from a file using fstream
 
In this incomplete project I happen to firstly write to a file and then extract data (read) from it, but the inserted data is not shown in output and some trash...
[8 replies] Last: .seekg() sets the get (read) pointer to the beginning. May not be need... (by seeplus)
pthread cout issue
 
I have a multithreaded program. At the code below, the first cerr gets printed, but cout at the end doesn't get printed. When I move the cout line before the pt...
[2 replies] Last: If you want us to be able to help you, you need to post more code than... (by JRManx)
Process finished with exit code 143 (interrupted by signal 15: SIGTERM) error message
 
Hi! I wrote a program using dynamic arrays and got the error message "Process finished with exit code 143 (interrupted by signal 15: SIGTERM)". Can someone h...
[4 replies] Last: Thank you both! Appreciate your help (by learning123)
RC4 encryption/ decryption
 
Hey guys, So, I want to implement the RC4 encryption but everything I found online was not quite helpful. I don't understand how it works. I have a strin...
[4 replies] Last: Thank you guys so so much! (by joe2014)
Trouble with simplest module example in C++ 20
 
Hi, Using VStudio 2019 v 16.9.1 with C++20 support it does not compile correctly. My interface file is called math.ixx and contains this: module; ...
[3 replies] Last: Current Visual Studio 2019 (16.9.2) support for C++20 modules is spott... (by George P)
Sudoku Puzzle Checker
 
This program will partially check the validity of a given sudoku puzzle. The user will enter the puzzle as 9 rows of 9 numbers in the range of 1-9. If the sam...
[10 replies] Last: déjà vu http://www.cplusplus.com/forum/general/276768/#msg1194648... (by Ganado)
by RicoJ
Const Rvalue reference becomes Const lvalue?!
 
Int&& i is a lvalue object, of rvalue int reference type. Below works as expected void foo(int&&){} int main() { int&& j = 7; //const int&& is that...
[5 replies] Last: Yes, it is a constness issue. [quote=mbozzi]You've attempted to make a... (by mbozzi)
Tarot Card Program Design
 
Hello! I am working on a final project for my intermediate C++ class. For the project concepts to be utilized we are supposed to implement the following: Ope...
[3 replies] Last: I was thinking of somehow trying to figure out how to implement multi... (by seeplus)
i can't get this programme to work
 
I can't figure out what's wrong, so could any of you please help me.Thank you all in advance here is the code #include <iostream> using namespace std; int m...
[5 replies] Last: #include <iostream> int main() { const size_t MAXPER {500}; std:... (by seeplus)
Defining my own heap isn't working - is my signature correct?
 
Hi, I am defining my own heap like so: class MyHeap { public: void* allocate(size_t size) { return malloc(size); } void deallocate(void* p...
[4 replies] Last: Thanks! (by JUANDENT)
by MALPY
problem including files or building
 
Hello, I have recently run into a problem regarding including files or building project in cpp. To try and solve this problem, i created a basic program to ...
[3 replies] Last: I have to add that i can compile everything using gcc directly on the ... (by MALPY)
How do I delete a current node in a linked list in c++? I have studied many sites, but my compiler refuses to accept anything
 
this is my first question on StackOverflow, so please forgive me if I did not fully indicate something somewhere, I will try to correct it I have been trying...
[2 replies] Last: Try this: #include <iostream> using namespace std; struct element ... (by seeplus)
by FluxT
Need help ASAP
 
Calculate the average mark with two decimal symbols. Generates school grades until the generated tag is equal to 10, but there must be at least 6 marks. Outp...
[2 replies] Last: What part are you having difficulty with? Do you know how to calculate... (by seeplus)
March 2021 Pages: 12345... 7
  Archived months: [feb2021] [apr2021]

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