Beginners - February 2021

How do I write a do...while loop in a class.
 
How do i fix this error? I understand it needs a function before the command but i'm not doing this in my int main(), so what else can go before. LINE 26 inc...
[5 replies] Last: Thanks! I think I kind of got the hang of it, i tried putting the func... (by FanOfThe49ers)
by icezy
Pointers
 
I am trying to run a program that intends to access data through pointers. But it not working #include <iostream> using namespace std; int main() { ...
[9 replies] Last: TO WHOM IT MAY CONCERN I was sent a PM by the user @ haibinz , an... (by JRManx)
Accumulator to average coin tosses Newer Method (MT19937)
 
Ok so here is the problem that was assigned: Using a loop and rand(), simulate a coin toss 10000 times Calculate the difference between heads and tails. Wr...
[3 replies] Last: For the large numbers in each experiment you should get an answer of a... (by lastchance)
Factoring Polynomials Program
 
I can sort of get the answer but it does not function properly. I would appreciate any help. Here is the root question: Example 6-16 shows how to write a pro...
[3 replies] Last: [quote=Deer Of School]I enter in: 1, 1, 1 or 2, 3, -2 It outputs: The... (by lastchance)
Help Understanding try and catch
 
Hello! For some reason, I just can't wrap my head around this despite reading multiple articles. I am implementing a circular linked list and within each node...
[2 replies] Last: I'm sure there are reading lists that include introductory materials f... (by Niccolo)
Accumulator to average coin tosses
 
Hello guys? I am a noob at C++, here is my problem I have to solve: Using a loop and rand(), simulate a coin toss 10000 times Calculate the difference be...
[3 replies] Last: Hello nickmcp11, I was working on your code when seeplus posted, So... (by Handy Andy)
(Simple) Variable changing value after iterating array
 
I am trying to iterate and modify an array of integers the value of n changes after the iteration: #include <cmath> #include <cstdio> #include <vector> #incl...
[5 replies] Last: There are 3 basic ways to work with a container. 1. declare the array... (by deleted account xyzzy)
by Gus60
waiting for a for loop to make 2 iterations before making a function call.
 
Is there a way to make a for loop iterate twice then call the function then iterate twice more. I am attempting a simple war style card game using arrays and fo...
[1 reply] : After thinking on it a bit more I realized that I could check if count... (by Gus60)
I'm not sure about find_last_of(
 
Hi! I tried to print words which end with "aty" and to count them using the find_last_of function. As you can see, there are four such words, but the execution ...
[7 replies] Last: @seeplus, Good point. I did not think about that. I will try the "rf... (by Handy Andy)
Trouble making a polynomial class
 
Hello i'm making a linked polynomial program that requires two classes. I'll put the description, and what I have below, I think I made the Term class correct? ...
[12 replies] Last: #include <iostream> #include <list> #include <initializer_list> using... (by lastchance)
std::begin()
 
Hi, I have been learning stuff about STL and currently learning to insert, mostly in vectors, but in general in sequential containers. In the past when using be...
[8 replies] Last: For info, there's also std::size() as well - and since c++20, std::ss... (by seeplus)
by Tallow
How to stop the game from ending after I press a button?
 
I recently made a text based game with an inventory but whenever I open the inventory the game stops. How do I stop this? #include <iostream> using namespace...
[5 replies] Last: Hello Tallow, At the beginning of your program you have these 2 if st... (by Handy Andy)
unresolved external symbol
 
I am not entirely sure why i got these errors: main.obj : error LNK2019: unresolved external symbol "public: __thiscall BlackScholes::BlackScholes(double,...
[3 replies] Last: You guys are completely correct. It was the linker issue. I was using ... (by invisibleninja852)
adjacent_difference Getting 2 Errors
 
I'm getting the 2 warnings on line 65 and 67. Not sure of what exactly the error meanings are telling me. If someone has an explanation for me, I would apprec...
[11 replies] Last: Thanks dutch! Appreciate the help! (by Brian845)
the question about move semantics
 
After learning rvalue reference and move semantics,it suddenly comes to me that rvalue reference are "better" than pass by value. Is that right?if not,in what ...
[1 reply] : CoreGuidelines: For “in” parameters, pass cheaply-copied types b... (by JLBorges)
by Ch1156
Why is this code not working correctly?
 
I'm trying to get an XP system working and for testing I want to be able to either set the players level, or give them XP and they will level up that way, so fo...
[4 replies] Last: Thank you, I got it working correctly now. One more question. Now th... (by Ch1156)
From Source code to executable file
 
<< run and hide ran away >>
[1 reply] : How a compiler works is not a topic for a beginner, more for a PhD stu... (by thmm)
How to test if function works
 
I'm new to this forum and just started taking computer software classes. Could someone please help me with trying to figure out the best way to test if my funct...
[3 replies] Last: Perhaps as: #include <iostream> const int ROWS {12}; const int COL... (by seeplus)
identifier is not defined and header file issues
 
In my main.cpp, even with #include "Blackscholes.h", there is still errors due to identifier undefined. I am not sure what went wrong. :( main.cpp #in...
[1 reply] : > Blackscholes bs; CaSe MattERS > class BlackScholes Also, the first ... (by salem c)
by medosz
Displaying only unique values in array
 
I am trying to write a program. It reads 5 integers between 10 and 100. As each number is read, the program validates it and stores it in the array. Then it dis...
[8 replies] Last: std::find is a function. A function that returns a value. What value d... (by keskiverto)
February 2021 Pages: 123... 12
  Archived months: [jan2021] [mar2021]

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