General C++ Programming - May 2021 (Page 2)

Memory usage problem
 
the memory usage of the below program constantly increases. how to fix this problem? #include <iostream> #include <string> class ChoiceTest { public...
[3 replies] Last: #include <iostream> #include <string> #include <algorithm> class Ch... (by seeplus)
Table of sorted numbers( entered in the command line-input)
 
Hello everyone, Im kinda lost, my task is : Number of integer​​(positive and negative) on the input. Write a table of the number of individual digits in ...
[4 replies] Last: You might use std::vector<int>. If you don't want use STL, try to writ... (by Pointee)
Opnemp code returns nothing?
 
I just started reading about openmp and was following with some sample codes, so I have the following simple example. But when I run the code on my terminal I g...
[6 replies] Last: @againtry Thanks! (by JamieAl)
Compile Errors, need help
 
I got the below compile errors. Any idea what could be wrong here? #include <iostream> #include <algorithm> #include <vector> class MergeNames ...
[6 replies] Last: Thanks everyone for quick help and suggestions. (by denver2020)
Finding a cycle path in directed graph
 
I am making a directed Graph class. I want find if there is any Cycle and update a vector with it's path accordingly. My Function some times work but others add...
[4 replies] Last: L9 - 10 should be: int V {}; list<int> *adj {}; The constructor ... (by seeplus)
the complexity of the algorithm
 
I don’t understand how to estimate the complexity of the algorithm below. By the most naive logic, we can say that there are 5 cycles. The first one is execut...
[12 replies] Last: Thanks! (by onetwo123)
by derpus
ERROR: Expected primary-expression before '.' token
 
I am fairly new to C++, & I'm starting to learn threading. The official error I'm getting is: Expected primary-expression before '.' token. I am using Code::B...
[2 replies] Last: AH yes! Thank you so much for helping me my friend! (by derpus)
Fraction
 
I created a fraction class but seem to have run into an error. What seems to be the problem? #include <iostream> #include <iomanip> using namespace std; ...
[6 replies] Last: If you search the forum for "fraction" and "rational" you'll find seve... (by dhayden)
Memory segments
 
Below are two codes. First, a process is created that creates a common segment and opens access to it for everyone. Second - reads data from the shared segment...
[2 replies] Last: You compute an integer value and display it on the first program's sc... (by onetwo123)
by Cplusc
Matrix assembly in fem using mpi
 
following my previous question regarding using MPI for finite element http://www.cplusplus.com/forum/general/278132/ I have made a few changes in my code. First...
[18 replies] Last: many thanks for your help. the problem was because of x and y. (by Cplusc)
by Iffahh
I am trying to create a program to calculate the price of the car. The loop user input twice. But I keep getting error.
 
#include <iostream> using namespace std; class AClass { public: int MyNum; string MyCarBrand; }; // for the class assign int main() { int br...
[5 replies] Last: A possible OOP based solution code could be: #include <iostream> #in... (by nuderobmonkey)
by Cplusc
FEM matrix assembly using MPI
 
hello, I am trying to solve the Poisson equation using finite element method with MPI. I already have the connectivity matrix and also I have the x and y coord...
[4 replies] Last: thanks for your help. (by Cplusc)
How to delete even element in an array
 
let say if my array is array ={2,3,4,5} I want to delete all the even element in the array so that the output becomes 3,5
[7 replies] Last: #include <iostream> #include <valarray> using namespace std; int mai... (by lastchance)
Reading in boolean function from a txt
 
Hi, I'm working on a project which needs to calculate the signal probability of a boolean function in the sum-of-product form. In addition, the boolean functio...
[1 reply] : What was wrong with the answers @againtry gave you in your other (iden... (by lastchance)
by mxkxx
array parameter
 
hello! i would like to know how to get the average of the ratings with 2 decimal places. i have tried some that i saw in the net but it doesnt seem to work. ...
[2 replies] Last: It's easier to compute the average as part of the input. #include <... (by seeplus)
This is my homework actually. I am new to C++ and still am unclear what the questions want.
 
Here is the question: You must write a complete C++ program based on the instruction below: a. Write a class named Name that consists of information such as fir...
[4 replies] Last: Ahh, thanks for your information. (by excavator)
What happens to a unique pointer type after using std::move?
 
If do something like this: int main() { std::unique_ptr<int> mInt = std::make_unique<int>(); // Move contents of mInt into mInt2 std::uni...
[5 replies] Last: Note that the code would be simpler if you used auto - cuts down the t... (by seeplus)
by mxkxx
ARRAY PARAMETER
 
It must allow the user to input the values for the Midterm Rating and Final Rating based on Figure 2. This must be achieved by a function call to inputRating(s...
[3 replies] Last: > This must be achieved by a function call to inputRating(stud, n). R... (by salem c)
by x01337
UrlDownloadToFileA Error
 
Hi everyone! I've been trying to use the AuthGG native C++ example, and when i try to call the UrlDownloadToFileA function, i keep getting unresolved ext...
[1 reply] : Also posted here -> https://stackoverflow.com/questions/67551618/authg... (by salem c)
Dynamic programming
 
I can't understand how to realize program with the help of dymamic programming. I understand idea(below) but I can't write code It is everything that I underst...
[12 replies] Last: However, this is what you get if you build and then traverse your pol... (by onetwo12)
May 2021 Pages: 12345
  Archived months: [apr2021] [jun2021]

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