Beginners - October 2020 (Page 11)

Error displayed
 
Hello, the code below displays an error, but I can't pinpoint why. Is this due to my use of constants? #include <iostream> #include <string> #include <cstdli...
[2 replies] Last: Change atoi to stoi and you'll be fine. There are null-terminated c-s... (by lastchance)
by syeare
Nested For Loop Help
 
Hello, I'm having an issue trying to implement nested for loop. I must accept 4 user inputs (range of length and radius) and display a table of calculated value...
[3 replies] Last: ++len is called pre-increment; len++ is called post-increment. Althoug... (by dutch)
Another extra number - C
 
Hello, My input as: 2 2 one 3 two 4 But I have to enter another extra number to finish the program. Why? How can I fix it? Thanks #inc...
[2 replies] Last: The issue is with using \n with scanf_s and using fscan_f. Consider: ... (by seeplus)
functions
 
Good day everyone, need your help cause I'm stuck with one task of my HW, I have to write a code in a specific way (using functions) which will count how man...
[6 replies] Last: #dhayden thank you master! I can't understand how I forgot that the v... (by MaxGreen)
Optimal value in a 3 dimensional array
 
Hello I wish to choose the optimal value in a 3 dimensional array is it possible to do it with this program: #include <iostream> #include <algorithm> #inclu...
[18 replies] Last: Hello, ok thanks for the details it's great. (by annolliwohe)
fstream cout problem
 
I think I have everything right except can't get it to output correctly I am using ifstream to get First names and sales from a txt file. The output should b...
[4 replies] Last: You don't need the for loop. #include <iostream> #include <string> ... (by seeplus)
interface, base class, abstract class?
 
Hi, I was trying to learn exactly what an interface was, and the site I was on has confused me about something else, that I am hoping someone could please clari...
[2 replies] Last: a class is made abstract by having a virtual function The missing wor... (by coder777)
by ebz
UDP Socket recvfrom fails to receive packet in non-block mode, but when off it works perfectly
 
I don't have the slightest idea why my UDP server is able to receive packets while the socket's non-block mode is off. If I turn it on so it doesn't block the t...
[4 replies] Last: Hey everybody, my apologies, I didn't know I got replies on this quest... (by ebz)
by ebz
Question about class inheritance
 
I have a base class that represent my game's scenes: // Base Class class GameScene { public: GameScene(const std::string& name = "Unknown Game Scen...
[2 replies] Last: Ohhh got it, got it. Now I know. Thanks Helios, worked perfectly! (by ebz)
by hbcpp
using concepts instead of SFINAE - Having trouble
 
I was able(with a lot help from the forum) to implement SFINAE in my std::list implementation. But in that time I couldn't use concepts so now that I can I don...
[9 replies] Last: std::input_iterator is already the concept you're looking for. Both ... (by mbozzi)
by hbcpp
Compiler picking the wrong overloaded function
 
I am trying to implement std::list. Here is the code stripped to only the part that is causing. Stripped to make reading better to be able to analyze the probl...
[3 replies] Last: One way would be to use cend(). I can do that, but the client code w... (by hbcpp)
by ZontYy
Incrementing the multidimensional array in a loop.
 
Hello, so I tried to complete one challenge on the internet, and I seem to cannot figure out, how to (or if it's even possible) increment specific space in ...
[4 replies] Last: For a 2-dimensional array of unspecified size, consider: #include <... (by seeplus)
Selection Sort Algortithm
 
Hello! Is the below code fine! I mean the idea of selection sort is that for each value of n, the inner for loop will execute n times, then n-2 times, then n-3 ...
[11 replies] Last: > Hye @dough4 I am just doing the loop analysis here. I am not impleme... (by anup30)
Struggling with the code and very new to programming and C++
 
Create a flowchart and Pseudocode and create a C++ Program. Prompt the user for salary per year and calculate a Christmas bonus based on number of years worke...
[1 reply] : Duplicate: http://www.cplusplus.com/forum/general/273221/ Please post... (by dhayden)
Change is always zero?
 
No matter what I put in for cost of item change comes back as zero? Is there a way to see what value is being passed from first set of code to the second? I hav...
[4 replies] Last: Yes it was from 100 you were correct. Thanks for your assistance. (by briancb2004)
by jax16
allocate memory, arrays
 
I found this program online, and I wanted to manipulate it some, but can't figure out what to fix, I keep hitting a bump. Here is the code. #include <al...
[6 replies] Last: Because the OP has a habit of deleting their posts after getting a rep... (by MikeyBoy)
by jax16
Make Class, Header and display results
 
Hello, maybe someone can help me with this.
[4 replies] Last: @jax16 Please do NOT delete your posts after they've been answered. I... (by MikeyBoy)
by aliez
cpp program for shopper how?
 
Write your question here. Project Overview The owner of a small shop selling books, magazines and movie DVDs wishes to set up a shopping kiosk at MMU....
[2 replies] Last: Hello aliez, This will help in understanding the tags: http://www.cpl... (by Handy Andy)
looping & generating strings by user input
 
I want to generate 3 strings, however, I'm having a problem generating a loop based on the user input of how many times 3 random strings should be generated int...
[14 replies] Last: Hello Leonardo797, Try changing line 86 to outFile << Str << "<br>"... (by Handy Andy)
separating two loops a part
 
EDIT: Please read my last reply, if this is confusing I want to loop each loop by itself, as you can see the first one and the second one will make random St...
[4 replies] Last: Thanks! I also solved it using for (int numStrings = 0; numString... (by Leonardo797)
October 2020 Pages: 1... 910111213
  Archived months: [sep2020] [nov2020]

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