Beginners - March 2019 (Page 23)

Assignment operator implicitly deleted
 
Hi I just received the following error message which I'm struggling to fix: *__result = std::move(*__first); ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ ...
[1 reply] : I think the issue is something to do with the constness of Element ... (by Enoizat)
Attempting to sort arrays using for loops, however if/else if statements are not acting as I expected.
 
My goal is to create a function which will sort an array so that a specific number (int e), is moved to the back of the array, but the order of all the integers...
[6 replies] Last: Update! #include "stdlib.h" #include <iostream> #include <cstdlib> ... (by JJDukes)
by kmce
Data structures - project advice
 
Hi, I am not looking for help with a certain piece of code. But I am looking for some advice in regards to a project I want to start. I am somewhat new to progr...
[1 reply] : A three room adventure. #include <stdio.h> #include <string.h> enum... (by salem c)
by cash
I need help
 
I have a project that deals with a nuclear wall containing neutrons, and I'm confused on how I should set up my code? Here is a link of the project https://ww...
[7 replies] Last: So basically in the for loop I should separately assign double angle... (by cash)
changing a US dollar bill with coins
 
Hello, i was working on a small program to find how many ways you can break a dollar. i was able to code a simple version that randomly chooses a coin value fr...
[2 replies] Last: I think so, just coding wise is were I'm lost. Would this be a multi d... (by sr2cute702)
Drawing a triangle?
 
I'm taking a class on C++ where we need to copy examples from a textbook, and despite copying an example exactly it is not working as intended. The program is s...
[1 reply] : It works correctly for me: C:\Users\Michael\Programming\foo> a Ente... (by Duthomhas)
Cant i write like this?
 
How could I store I in p if not? if (num%i == 0) i >> int p;
[2 replies] Last: you may have seen something a little like what you are trying to do wi... (by jonnin)
by mpg
String problems c++ (1,2)
 
I have these problems c++. 1) Write a function with 2 parameters x and y, x string, and y character. The function returns the number of occurrences of y in x. ...
[32 replies] Last: I don't think I can help you any more. You should find someone who can... (by dhayden)
mt19937 is giving me the same number
 
I'm trying to understand how rng works but everytime I run my program it gives me the same number. I can't figure out what I'm doing wrong and I couldn't unders...
[13 replies] Last: Hashing seeds is a common idea taught to people, but a bad one. See, ... (by Duthomhas)
Is it still worth using classes if I will use only 1 object of a class?
 
As the title says, I'm curious about this. Thanks =)
[3 replies] Last: Thank you, guys! (by caesarra2)
continue to get two answers.
 
HELP!?!? When I run the code, any number that I input bigger than 1 I get two answers. I am not sure what I am doing wrong, I have tried changing the brackets a...
[2 replies] Last: @Grime Thank you! That wasn't quite it but it got me to figure out how... (by ThomasJimenez23)
I cannot understand random generated value: why infinity?
 
Example code: #include <chrono> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <random> // tune the iterations...
[4 replies] Last: Yes, Peter87, you are right, I just didn't want to admit I have proven... (by Enoizat)
using std::function in a library
 
I am attempting to use a std::function that SHOULD be in a library, but it does not seem to work. I then dumbed it down to just attempting to link 2 object fi...
[3 replies] Last: Thank you! I will read up on extern. I always had the impression it ... (by JMJAtlanta)
Only Accept Numeric Character in std::cin
 
If for example '32a' was accidentally entered instead of '32', I want the program to reject this and ask for the input again, instead of accepting the '32' part...
[13 replies] Last: Duthomhas said See the trick there on lines 11 and 14? Use a st... (by calioranged)
How can I read .txt files in directory with c++?
 
Hi, i want to read txt files in a directory and after, ı want to put these files into a list. How can I?
[2 replies] Last: Probably something like this: #include <filesystem> #include <iostr... (by Enoizat)
by jesi
How to get day = dayweek
 
i'm a newbie and i don't know how to get day = dayweek, #include <iostream> using namespace std; string dayweek(int daynum) { string dayname; ...
[3 replies] Last: Hello jesi, In addition to what Grime has said. You will never reach ... (by Handy Andy)
Object value is not saving as it is passed through classes
 
I am working on creating a Game of Life in C++ for my Data Structures course. I've been stuck on this for a few days and am officially stumped. I am having trou...
[5 replies] Last: Inside UerIO::Config(), you can access class members h and w by just r... (by dhayden)
Exporting a cipher from a text file.
 
I seem to be having a problem with this program I am coding. I understand what to do in context, I just am unaware of how to output it in code. What I am try...
[2 replies] Last: Hello MrPolynomial, PLEASE ALWAYS USE CODE TAGS (the <> formatting ... (by Handy Andy)
by cu123
I need help with this please
 
A t-shirt shop sells shirts that retail for $16. Quantity discounts are given as follow: Number of Shirts Discount 10-20 ...
[5 replies] Last: 42?? where did it come from If Douglas Adams were still alive you co... (by closed account E0p9LyTq)
Help with Arrays
 
Hello, i wanted to ask something. For example i have an Array called bool Marked from 0-9 and i want to use something like this if(!Marked && Marke...
[3 replies] Last: Depending on quite what logic you are implementing you could use one o... (by lastchance)
March 2019 Pages: 1... 2122232425
  Archived months: [feb2019] [apr2019]

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