Beginners - November 2020 (Page 13)

_Right_datqa was nullptr error
 
Hi, I'm doing a project in my text book about Link-List called "Pile of Books". I am trying to create a remove method that removes the first node in the list. ...
[3 replies] Last: THANK YOU!!!!!! (by JamesHelp)
make it shorter
 
hey , can someone make my code shorter and delete the parts that are not needed ?? thank you in advance #include <iostream> #include <stack> #inc...
[9 replies] Last: #include <iostream> #include <string> #include <stack> using namespac... (by lastchance)
find the sum of infinite series
 
x=(-1;1): 1/x + x/3! - x^3/3*5! + x^5/5*7! - x7/7*9! .... find the sum of terms of infinite series with a given accuracy eps by the user i know i should use 'f...
[4 replies] Last: @lastchance thank you lots! yeah, the first term is definitely 1/x, th... (by laura fidarova)
Area of overlapping rectangles
 
Hello. I have a task and it says that I gotta find the area of the overlap of 2 rectangles by entering their bottom left coordinate /x,y/, height and weight. Ca...
[7 replies] Last: left=max(bottomLeftX1, bottomLeftX2); right=min(upperRightX1, upperRi... (by lastchance)
Adding to array of pointers causes segmentation fault
 
I'm creating a program that resembles a store which manages products and customers. I'm having trouble with adding customer objects to the store as it keeps cau...
[2 replies] Last: Do you perhaps mean something like getId() instead of getNextId() ? ... (by dutch)
Spaces placed in output
 
So in this project I'm supposed to output a char, input by the user, a number of times input by the user. I can do that fine enough but there's supposed to be a...
[4 replies] Last: Hello DevonMeep, I will make 2 points. while (counter <= n) // <-... (by Handy Andy)
Switch Statements over different functions.
 
Hello Everyone, I am having trouble seeing what I am doing wrong in my program. We just started functions, so I suspect I have a misunderstanding there. Anyways...
[5 replies] Last: Hello runningbear, Before I forget. The "mainMenu" lists the choices... (by Handy Andy)
Disappointed (1,2,3)
 
I am greatly disappointed with Visual Studio and C++. 25 years ago I took a course in college and didn't not have the kinds of problems I am having now. With Vi...
[55 replies] Last: mathman, (1) You don't need to use static linking (2) The only signifi... (by Ganado)
const char** is incompatible with parameter of type const char*
 
Hi, I was working at making a really basic game of cards but when i call the function couple(face) it says: Error (active) E0167 argument of type "const char ...
[3 replies] Last: if (deck == card) { conf = face ; } conf has only... (by seeplus)
Array and inFile problem
 
I have been tasked with fixing this code below. You can already see the changes I made with my notes. #include <iostream> #include <fstream> //added fstr...
[3 replies] Last: You don't need the array or 2 loops. The sum and finding the max value... (by seeplus)
How can I remove these #define's from the code and change them to something better?
 
Hey there, I have a few questions about the #define's being used in this code, I never use them in my own code, and I'm not exactly sure how the following ones ...
[4 replies] Last: I agree that macros can be the devil incarnate. However, my advice as ... (by seeplus)
Need for code explanation
 
Hello! I got a code, for avoidance of any signs input, despite "int" characters. Please, explain me step by step what exactly is happening here? w...
[2 replies] Last: while (cin.get() != '\n'); is often replaced with: std::cin.ig... (by seeplus)
Integrate - this may be an intermediate question
 
I can't figure out how to NOT get infinity when I integrate through this equation. I need to integrate from 0 to pi/6 but the denominator hits zero at one point...
[9 replies] Last: You would do far better to transform the integral to avoid the singula... (by lastchance)
Call function from another class
 
Hello, I have a program written in C++/XAML where if you click a button, the settings page will appear (by setting a frame's visibility to visible). On the sett...
[1 reply] : You actuall need to pass the pointer of the MainPage to the Setting... (by coder777)
Finding new problem, error: expression did not evaluate to constant
 
This is the first time I use pointers or struct. If someone can kindly help me with this problem. My code needs to find the best possible combination of weight,...
[17 replies] Last: I changed the variable names to more meaningful names and have managed... (by againtry)
For loops
 
Are two initialization of a counters allowed in a for loop? (I'm new) #include <iostream> int main() { for (int i = 0; i < 100; i++ && int a = 1; a < 100;...
[11 replies] Last: Thanks Andy! Will do! (by AnMTGDude)
gtkmm ToggleButton help
 
I am following a beginner tutorial on gtkmm, and the online tutorial doesn't really explain things like how to create widgets. It just explains to you what eac...
[1 reply] : It looks like it's not the way to bind paramters. See: https://wiki.i... (by coder777)
by maulk
How would I put this together in a main function?
 
#include <iostream> #include <string> using namespace std; int convertRomanToInt(string input); int romanCharValue(char r); int main() { cout << "P...
[6 replies] Last: Yeah, they've done it on other threads, so I thought I'd make sure the... (by MikeyBoy)
C Programming - File io parsing strings using sscanff
 
I am trying to do the following the C programming language, any help or if you can finish the code I will be greatly appreciated: I am trying to write a prog...
[3 replies] Last: Once you have sorted out parsing the arguments, then a possible way to... (by seeplus)
Cpp for loop
 
Hi all, How to write the below if condition in cpp? Here the vector elements are x = 10,20,30,40 y = 60,10,100,120 Both x and y are vectors. Ho...
[3 replies] Last: I would suggest using std::find https://www.cplusplus.com/reference... (by Norm Gunderson)
November 2020 Pages: 1... 11121314
  Archived months: [oct2020] [dec2020]

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