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

Writting in a saved File.
Open the file in append mode. Run this program a few times and observe its output: #include <iostream> #include <fstream> #include <string> int main() { ...
[no replies]
Assigning local lambda makes for dangling reference?
Hi, I have a local lambda that is assigned to a field of an object called storage. This lambda will be called from elsewhere and my concern is whether this lam...
[7 replies] Last: > How do I know it is moved assigned? The standard specifies that st... (by JLBorges)
Conceptual: Assigning threads to different CPU cores , Mutexes vs Semaphores
Hello, I am trying to figure out some things relating to a learning exercise in Operating Systems. We must explain, conceptually the following. 1. What is th...
[2 replies] Last: 1. What is the disadvantage of always assigning a thread to a differe... (by kigar64551)
recursive (1,2)
could someone explain how to do the recursive portion on this #include <iostream> #include <iomanip> #include <algorithm> // for min, max using namespace...
[34 replies] Last: From JLBorges post above: int mul( int a, int b ) { if ( b == ... (by seeplus)
using classes for calendar helper (1,2)
looking for help on this code I have no idea how to continue from this point #include <iostream> #include <iomanip> #include <string> using namespace std; tem...
[22 replies] Last: I've tried to make my code less confusing I have Set Day done..( case... (by ocKiNOsIi)
Elaborated type specifier syntax
I need a simple "Elaborated type specifier syntax" example and when to use it?
[no replies]
memory mapping
i am trying to map an exe file in memory than write to its text section and than write it back to disk. while debugging it shows data successfully written in th...
[9 replies] Last: thought mapping a PE will sort of emulate how a PE looks in memory ... (by kigar64551)
by Cplusc
Metis for finite element triangular mesh partitioning
I am trying to use Metis to partition a finite element mesh. however, In the metis manual I read something that made me feel confused a little. "All of the me...
[6 replies] Last: When I obtain eptr and eind according to what we have discussed here s... (by Cplusc)
by pika77
howw to pass user value using same variable between function to function
/* Given the following C++ program, #include<iostream> using namespace std; int main() { int n1,n2,sum; cout<<"Pls enter 2 number: "; cin>>n1>>n2; s...
[2 replies] Last: thks bro!! my code finally works XDD (by pika77)
by volang
I need a corresponding solution in C++ for an OpenSSL command
In , there is a section called "Server Encryption Keys Calculation". If you open it, then click on "Show code" (the second one), you'll see what...
[4 replies] Last: Thank you kigar, this helped alot. Finally I got it to work with the h... (by volang)
by Cplusc
array of pointer
In the following piece of code, I have a problem of reading memory. When assigning value to adjncy It says "unable to read the memory". I can pass the adjncy va...
[4 replies] Last: Thanks for you explanation. I got it. (by Cplusc)
and the c++ question is? There is the c++ std::sort() which can be used with an appropriate comparator.
[1 reply] : #include <iostream> #include <vector> #include <utility> #include <al... (by lastchance)
Understanding pointer to a vector of pointers code
(I didn't write this code. This is an existing piece of code from UC Berkeley's parallel algorithms homework which I should parallelize using Pthreads) There i...
[2 replies] Last: or, you misread it. new works like this: pointer = new type; //one it... (by jonnin)
cannot display output
in this code, I need to write and always update the file, I had done this part, but I try to display the output, it only displays the first data. and when I do ...
[2 replies] Last: will work on it! thank you! (by saltyyyyy)
by volang
Namespace conflict
I have "using namespace std" in my project. At the same time I'm using bind() from winsock which is global. I know there is a function called "bind" in the std...
[1 reply] : note that the template argument i... (by ne555)
"No matching function for call" error in linked list
I'm adding a copy constructor and overloaded assignment operator to a linked list header file and implementation file, but I am getting notes and errors from th...
[2 replies] Last: the compiler can't read your mind. you haven't defined a constructor f... (by ne555)
December 2021 Pages: 123
  Archived months: [nov2021] [jan2022]

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