General C++ Programming - June 2021 (Page 4)

std::function wont print out trapezoidal integral, lamda won't take function parameter.
 
I need help with implementing the trapezoidal method in std::function and using the lambda function. Is there a solution or a help to it? I don't want to ...
[9 replies] Last: It's a good thing that you are keeping an eye on my bad code, Albatro... (by lastchance)
Need HELPP with my assignment
 
The structures to be implemented in the context of work are 1) Unacceptable table, 2) Classified Table, 3) Simple Binary Search Tree, 4) AVL type Binary Tree an...
[4 replies] Last: Oh, and welcome to the forum. Looks like we frightened the skittish ... (by George P)
Need help commenting out the code
 
Hello, so i have a task: I have a sequence which contains from 3 to 30 words, in each of which from 1 to 5 spelled Latin letters; between adjacent words - a c...
[7 replies] Last: It helps if you format the code so that it's readable and use code tag... (by seeplus)
syntax error in code, do not understand why
 
```++// Computation.cpp - This program calculates sum, difference, and product of two values. // Input: Interactive // Output: Sum, difference, and product ...
[3 replies] Last: nevermind, figured it out! thank you! completed code: ``` // Computat... (by yellowslotcar)
Remove prefix and suffix from char array
 
Hello! I am working on getting back into school after a year off. I am doing all of my assignments from my last CS class over again and there was one assignm...
[14 replies] Last: #include <array> #include <string_view> #include <iostream> #include ... (by mbozzi)
Using std::move on std::shared_ptr<SomeClass> correctly
 
I am working on a project and dealing with shared_ptr's. The program is working and giving the correct output. However upon looking at the logs i notice that at...
[4 replies] Last: 1. Moving temp_vector into an element in temp_2d_vector will indeed no... (by helios)
rounding between C++ and java
 
I have a Dell desktop with an Intel CPU running Linux. When I write a C++ program with this line: for (int i = 0; i < 10; i++) printf("%.1f\n", (i + .5) /...
[3 replies] Last: @jonnin, you need to also use "fixed" mode to duplicate the printf out... (by dutch)
fx call prototype errors
 
Errors below. How do I call this function below separated .cpp/.h ? main { ... set_intrinsics(cam_intrinsic); } .cpp ... void set_intrinsics(...
[7 replies] Last: Also useful to provide: http://www.sscce.org/ (by Ganado)
by Cplusc
finite element matrix assembly in csr format using MPI
 
I am trying to assemble the global stiffness matrix in finite element in csr format. with one processor everything is fine but with two processor the number of ...
[2 replies] Last: @resabzr, Please learn to debug - all you have to do is print out some... (by lastchance)
I/O from cin or ifstream
 
I want to do input from std::cin, or from the file specified in argv . How do I do this in idiomatic C++? Here's what I want to do in C: int main(i...
[10 replies] Last: Thank you everyone for your replies. They have given me much food for... (by tshemphill)
linker errors, already defined in an another object
 
so i creadted this 2d game using sdl it worked fine, but then when i started optimizing it, seperating the header files and the cpp files, there were no errors ...
[17 replies] Last: The problem with multiple definitions is with the contents of the incl... (by seeplus)
cout << endlines(x); operator overload for a function
 
Hi, i wanted to make a function which makes a spacing for a line every time I call cout. but I am stuck. my main goal is to use this line of code to work: c...
[8 replies] Last: I have sometimes used std::array<char, n> to return strings from funct... (by helios)
containing loop
 
when I compiling this program it gives me this error ////////////////////////////////////////////////// //////////////////////////////////////////////// In ...
[9 replies] Last: @againtry thank you, my dear friend. the program works well. I will co... (by abdelrx01)
Template metaprogramming to auto-detect race conditions
 
I read a GitHub project description about using template metaprogramming to auto-detect race conditions, and I wanted to learn more about it and how it can be i...
[5 replies] Last: I am going to have to go over that a few times. Yeah it's pretty nea... (by mbozzi)
identifier not found
 
Hi, trying to split a function between a .cpp/.h and accessing it in main by calling that function. I keep getting the same error "identifier not found" though...
[4 replies] Last: Adjusted. Thank you. main.cpp #include "pch.h" #include <iostream... (by technologist)
sdl configuration problem in vs code
 
im new to vs code, i have been using vs 2019 for so long but now I'm moving towards vscode, I know this question has been asked too many time but believe me I t...
[no replies]
Dice c++
 
Hello, i'm trying to make a c++ dice, i have to declare all the 10 rolls, lowest, highest and the total value. I could make it work if i wrote all the code insi...
[2 replies] Last: As a starter, consider: #include <iostream> #include <cstdlib> #inc... (by seeplus)
What is the best way to learn to write pseudocode
 
What is the best way to learn to write very clear pseudo-code (using easy-to-understand statements, not including syntax that is not easy to explain), and simil...
[3 replies] Last: There's no definition of what pseudo-code involves. Some programming c... (by seeplus)
Undefined reference error.
 
In this main I have omitted the class Of quiz which Reads Quiz from the File and use it for this application. Then I stored these questions in the vector of Qui...
[17 replies] Last: I'm kinda curious if it would break if you initialize a container of... (by doug4)
Output not reading correctly for pond simulator:
 
The output should look like: WEEK 20 RESULTS Fish With Weight 20 Plant weight 13.95 Plant weight 21.05 Plant weight 45.19 Plant weight 19.74 Plant weig...
[5 replies] Last: @GroovyJack. This is again quite a complicated exercise. Also you have... (by seeplus)
June 2021 Pages: 12345
  Archived months: [may2021] [jul2021]

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