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

Array output formatting
 
Hello all, I have stumbled upon another issue with some of my classwork. For this part, we have to display the information from a dynamic array in a neat and...
[1 reply] : One way to handle these arrays of pointers, is to only use new where t... (by kbw)
C++ Functions Assistance
 
Hello All! I am new to C++ and am currently stuck doing this problem. I am having toruble on figuring out how to go about doing the sell games function which ca...
[1 reply] : The function isn't the problem, I think the problem is that you haven'... (by kbw)
Switch Statement Void Problem
 
Hello everyone. Whenever I pick a number in my code and enter the input below, the "cout << Your Personality is ..... " sentence doesn't print. What seems to be...
[2 replies] Last: Oh, I see so that's why it doesn't print. Thanks, man. I highly apprec... (by ForgottenLaw)
STL functions which work on vectors
 
Is there a document or book which has a list of all the stl functions ? I need stl functions 1) I have a vector of an ItemSold object with name and qty(acro...
[4 replies] Last: Use of map would be logical, but then you don't need any std algorithm... (by keskiverto)
How to import std.core when building a debug application?
 
Hi. In VStudio 2022 I get this warning when building a debug build when using: <code> import std.core; <code\> warning C5050: Possible incompatible environmen...
[no replies]
by RVan
Returning to 'formal' programming
 
I need to resume programming and I have decided to do so with C++. I have found some useful online courses but thought a forum could be useful as well. Are ther...
[no replies]
by RZgerr
Struggle with matrices
 
I am struggling to complete this matrices task. I just need the program to display each matrix and stat if they are equal. I would really appreciate any help of...
[2 replies] Last: In C++ it's preferable to use constexpr instead of #define. Perhaps: ... (by seeplus)
Multithreading and shared memory
 
Hi, This isn't really a C++ specific question, more low-level programming in general. In class we were tasked with applying a filter to an image in parall...
[3 replies] Last: Thank you very much. This was a far better answer than my professor wo... (by DrZoidberg)
STL Functions vector processing
 
I want to use an STL function on a vector of strings. The final objective is to get the index of the string which is least letter different from the next. ...
[11 replies] Last: When there is a need to use std functions then (using my algorithm) I ... (by coder777)
Need help with this project reading file
 
/* Name: [Insert Name] Project: GradeReport.cpp Topic: Using files and reading strings and numbers Date: [Insert Date] Description: T...
[2 replies] Last: Line ???: Do not loop on (! stream.eof()) or (stream.good()). This doe... (by AbstractionAnon)
Sales and Profit Program
 
Hello I need help with my c++ program, A well-regarded manufacturer of widgets has been losing 4% of its sales each year. The company’s annual profit is 10% ...
[4 replies] Last: Thank you so much sir (by maureen22)
How to use C++ modules with a Makefile?
 
I have a Makefile which is minimal, yet complete. It is the following: OUT = example INSTALL_DIR = /usr/local/bin OBJECT = ./obj SOURCE = ./src SRC := $(she...
[3 replies] Last: Actually, GCC can compile C++ code Maybe, but don't even try it. Two... (by kbw)
Logical Error Help
 
Hello. I need help with the logical error in finding the GCD of the two numbers that I've committed below. The output should be 0.03 but the output that has bee...
[11 replies] Last: Thank you so much for the information guys. Especially for @jonnin, No... (by ForgottenLaw)
by Cplusc
Matrix-Vector Multiplication
 
Hello, I am trying to do a matrix vector multiplication using MPI. The matrix is a diagonal one, so I store the diagonal elements in a vector. then I distribute...
[6 replies] Last: Yes,it's working now, thank you. (by Cplusc)
integers
 
how do i implement "int getSum(int A, int B, int C) into this code" #include <iostream> #include <cmath> using namespace std; //int getSum(int A, int B...
[6 replies] Last: @Furry Guy thanks I see it in the examples now (by ocKiNOsIi)
Finding Modulo Problem
 
Hello guys. I need help in finding the modulo/remainder of the two numbers (which also includes numbers in decimal and negative format). I wonder what's wrong w...
[3 replies] Last: Tnx for the help guys. I appreciate that. I just post this as a refere... (by ForgottenLaw)
How do I read a command and a user specified string together?
 
My program gives the user a list of options such as "help", "exit", "create file", etc. If the user chooses to create a file, the user will write "create [inser...
[2 replies] Last: It's called parsing. std::stringstream is handy for parsing. Somethi... (by AbstractionAnon)
No match for operator erro in C++
 
Hi While compiling my code it give me error. Please help me .... no match for 'operator>' (operand types are 'std::string {aka std::basic_string<char>}'...
[1 reply] : Well, you can't compare an int and a string. 42 is not greater than "a... (by Ganado)
How to sum two arrays into a third array
 
Hi, im new at c++ and I would like to make two arrays that have 8 values each and each value is generated by ran(). After this I would like to sum each value in...
[2 replies] Last: Ok, I have made the program but now my problem is that I dont understa... (by trancamalanga)
Help me in Understanding Recursion 2
 
Hello everyone, I need help in understanding the recursion on how does it end in 12345678910. When I tried to understand this problem, I expected that the outpu...
[8 replies] Last: yes, recursion gives you a 'free' stack data structure effectively. t... (by jonnin)
November 2021 Pages: 123456
  Archived months: [oct2021] [dec2021]

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