Beginners - September 2020

Help
 
How do I write the following program? If we have the variable a and b (condition that the variables can have up to 1000 digits), and we can enter the variable a...
[6 replies] Last: That was really close Ganado. #include <iostream> #include <string> ... (by Manga)
Barcode reading for invalid inputs
 
I am currently writing a program for converting zip codes to barcodes. One requirement for the program is that the user must enter 5 digits for the zip code, an...
[4 replies] Last: I am not sure how it is working for yo when you are missing the heade... (by MikeyBoy)
Expected primary expression before int error
 
Hello all, my program is just about done, but i'm receiving an error trying to call my binary search in main? - line 71 #include <iostream> #include <fst...
[5 replies] Last: Thank you! The bottom one worked (by FanOfThe49ers)
Help please
 
Hello all, I am needing to set this up for class and I can not figure out where I went wrong. No matter what door I put in, i.e. One, Two Three, Four, it alwa...
[8 replies] Last: Thanks all for the input. Heres what I fixed now. And it works. My pro... (by jadams0904)
Why won't my selection sort, sort the code
 
My code is remaining unsorted when i run the program? Also where would i prompt the user to choose a number after or q to quit? -- line 57 I know i need a swap...
[5 replies] Last: Your original code works find if you (1) actually call selectionSort; ... (by dhayden)
Unused variable issue
 
Hi, I am currently writing a program for converting zip codes to bar codes. When attempting to compile my program it says that my variable checkDigit is set but...
[1 reply] : if(sum > 0) { checkDigit = getCheckDigitValue(su... (by Ganado)
What are the best [free]resources to learn C++ particularly for quantitative finance?
 
What are the best free, online resources to learn C++ for quant finance? The course by quantnet seems too expensive for a broke student like me! https://www.tal...
[no replies]
What's wrong with my program? (Basic C++ Do While)
 
I'm currently doing an assignment for C++ (Beginners Class) and can't seem to get my program to successfully repeat itself upon the asking of the user. I know t...
[6 replies] Last: Build builds the solution using files as specified by the Solution Exp... (by seeplus)
getting accurate numbers
 
QUESTION: so I have the code except the results are not accurate, I tried double and float Here is the code cout << '\n'; cout << " The guessed ...
[2 replies] Last: thanks salem! nice toys! (by Leonardo797)
by hnflrt
Why do i get this error?
 
The error i get cannot convert 'std::vector<double> to double in return at return aboveAverage; line double aboveAverage(vector<double> columnsList) { ...
[6 replies] Last: Declare a new vector at the start of the function; something like vec... (by lastchance)
BMI calculator
 
Write your question here. Hi, I have to write a program who calculates the BMI for a male or female, but i got a arror: uninitialized local variable 'geslac...
[4 replies] Last: Also, if not already mentioned, the type of geslacht should be int, no... (by againtry)
array / vector
 
Hi, I am trying to practice some c++ problems and someone suggested leetcode, which I am failing miserably at but thats not the point of this question. I have s...
[6 replies] Last: Same program with some more standard library: #include <iostream> #in... (by keskiverto)
Setfill and repeat
 
I am working on a lab and my code works with no errors. The problem is, she wants setfill used for dividers, instead of setw/string, which is what I have. I am ...
[4 replies] Last: Hello Tsunami, Now that I have had the chance to work with all the co... (by Handy Andy)
function-definition is not allowed here before '{'.
 
Why am i getting this error if i clearly stated it before main? (located by comment that says perform a binary search) - line 78 #include <iostream> #i...
[13 replies] Last: Okay got it, the better you become the better it should be organized a... (by FanOfThe49ers)
a BUG!!
 
The code explains it all, I have a variable in my main function, I want to increment it via a function named Increment, when I log the variable in the console, ...
[10 replies] Last: In C++ by default all arguments are passed by value . This means that... (by seeplus)
Size of Char in C++
 
Hello, Could you please explain this? Thanks #include<iostream> using namespace std; int main() { cout << sizeof('A') << endl; //1 Byte // ...
[8 replies] Last: Reading a book about C isn't particularly helpful, unless you're going... (by kbw)
by alix
How to delete an object from heap allocated array
 
I am a beginner, and I want to delete an item from an array, non-STL. This doesn't seem possible? Below. So, out of share curiosity, how can I delete or remov...
[6 replies] Last: Object* o = new Object ; `o ' is an `Object', it is not a pointer ... (by ne555)
by alix
Adding Range Based Support to Class
 
I am trying to fix, so that range-based for loops are supported with my custom class. I am also trying to search for an employee, but my search gives me wrong r...
[9 replies] Last: If a non-pointer if returned then they are needed. They are needed in... (by coder777)
by Grime
(0 < size_t(0) - 1) is true
 
I came across this while writing code that resembles this: std::vector<int> nums; for (int i = 0; i < nums.size() - 1; ++i) { std::cout << nums.at(...
[13 replies] Last: Thanks (by Grime)
Using an ABC object as a class member
 
Hi I'd like to write a class which has a member variable which is an object of a type which inherits from an abstract base class (ABC). I understand that an AB...
[1 reply] : If you want to use polymorphism, you would have getSOM() be a virtual ... (by Ganado)
September 2020 Pages: 123... 10
  Archived months: [aug2020] [oct2020]

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