Beginners - May 2018 (Page 4)

Arrays homework question
I have this homework question: Write and test a program that read in n integers (max value for n is 20), each integer has a value between 0 and 100 inclus...
May 23, 2018 at 4:13pm
[5 replies] Last: Just saw Andy's second response -- yep, this is the second strat I was... (by icy1)
Getting an extra \n somehow.
Hello, My code is printing out an extra \n somewhere and I cannot figure it out. I run the code against a testbed that replies with user input. The code works ...
May 23, 2018 at 3:58pm
[4 replies] Last: Hello jcthomas556, You are welcome. Sorry I got a it behind. With ti... (by Handy Andy)
Variable value not resetting after loop
Hello i am new to c++ and i'm trying to do a program for a restaurant cashier machine and i'm having a problem with the looping. basically the program is supp...
May 23, 2018 at 3:54pm
[3 replies] Last: So pass those variables into functions as arguments. Global variables... (by MikeyBoy)
Transparent Child Windows
As the title suggests, i am trying to create a transparent background child window as a text label over a png button. So far I have this: vesav.com.au/logo/d...
May 23, 2018 at 1:18pm
[5 replies] Last: is this what you are wanting? #include "stdafx.h" #include <window... (by rjphares)
by DellXT
C++ Rotate the given matrix the specified number of times
Rotate the given matrix the specified number of times. My code rotates only one time (90 degrees to right). How to write a loop or something that it could work ...
May 23, 2018 at 10:13am
[5 replies] Last: #include <iostream> #include <fstream> #include <sstream> #include <i... (by lastchance)
by wsme
Stopwatch with negative time in C
Practicing my use of time() in making a stopwatch. But it seems that I have misused it as the call returns a negative value. What is going wrong? (structs also...
May 23, 2018 at 4:49am
[7 replies] Last: #include <stdio.h> #include <time.h> void stop_watch() { puts( "... (by JLBorges)
Im having a problem with classes Please help
So I am writing a program that is supposed to produce a rational number (numerator/denominator) and the program works until I need to call .reduce() I am pretty...
May 23, 2018 at 4:12am
[3 replies] Last: tpb you are an angel, I have been looking at the gCD function for so l... (by FizleYoWizle)
What is the difference between reading from console and reading from keyboard?
Hello. I have 2 different assignments; one asks me to "Read a string from the keyboard and display it" and the other "Read a string from console and display it"...
May 23, 2018 at 4:01am
[4 replies] Last: Write your programs to read from standard input (use std::cin ) ht... (by JLBorges)
Pig-Latin translation program
Hello, I'm trying to make this piglatin program for my computer science class. I have the general code done but I am having trouble creating the loop for the wo...
May 23, 2018 at 2:14am
[2 replies] Last: Thanks tpb I figured it out a different way but here is my solution in... (by FizleYoWizle)
Question about operator.
Hello! Can anyone explain to me what "Player(const Player &p)" and "Player &operator=(const Player &p)" does? Is the "&operator=" overriding the p? I'm just con...
May 22, 2018 at 11:58pm
[2 replies] Last: Is the "&operator=" overriding the p? The Player& return value shoul... (by Ganado)
by DellXT
Is there a mistake somewhere?
Finding max, min and avg of the array. Is there a mistake somewhere? In one test it shows RTE - round time error. How to fix it? #include <iostream> #inc...
May 22, 2018 at 7:52pm
[6 replies] Last: Why are you posting your code without code tags like an idiot? (by tpb)
by Delgeo
Why Does a Function with two differing variable types work?
Hi all, why does this work? the function type i wrote is int, but i have a string in the argument area? Sorry for the Noob question.. Can you help me understand...
May 22, 2018 at 7:34pm
[3 replies] Last: Here's an example to help you visualize a common pattern of returning ... (by icy1)
by DellXT
Giving only unequal results C++
Solving cubic equations. Needs to be improved by giving only unequal results (e.g. 0_0_3 -> 0_3) #include <iostream> #include <cmath> using namespace std;...
May 22, 2018 at 6:36pm
[9 replies] Last: Are you past calc 1? If so, you can take the dx of this function easi... (by jonnin)
Can't get the right answer
So I was trying to figure out why I get the wrong answer but I just can't. There is a clock. The first day s he will be late 15 seconds. Next day s1 it will be ...
May 22, 2018 at 6:06pm
[5 replies] Last: Agreed with Repeater (day 37), except 15 + 36*25 is 915 seconds, not 9... (by icy1)
Bubble sort repeats text
My project is to create a bubble sort that puts the numbers in ascending order. My code works but the text "Please enter 6 numbers in any order" repeats 5 tim...
May 22, 2018 at 4:56pm
[4 replies] Last: Thank you very much (by Caesar est mortuus)
by DellXT
Complicated
Can anyone help to solve this one? There is given two numbers n and m (1 ≤ n, m ≤ 10^8); 1) Divide n from 2 until 1. 2) Multiply m from 2 as ...
May 22, 2018 at 9:36am
[4 replies] Last: It worked. Thanks! (by DellXT)
Creating A Simulated Output
i need to do this and am unsure how to generate the computers output the question is as follows: Add code to generate the computer's choice. Use the rand() fu...
May 22, 2018 at 8:54am
[1 reply] : Maybe like this: #include <stdio.h> #include <stdlib.h> #include <t... (by Thomas1965)
by kainev
Buffer to store multiple values of different types
Hi all, I've been working on a dependency graph (like the one found in Autodesk Maya). Every node in the graph derives from a `DependencyNode` class, a node ...
May 22, 2018 at 5:34am
[12 replies] Last: Could you provide a short example on the usage? An object of type st... (by mbozzi)
Unexpected E0349 error
I have two instances of the following code just built in two different projects on the same visual studio package on the same machine at approximately the same ...
May 22, 2018 at 12:11am
[1 reply] : Try adding #include <string> and moving "using namespace std" to just ... (by tpb)
emplace back
Hi guys I am writing a kind of self messaging maybe you could even call it a memo or notes to self console application,very simple stuff I am trying to use t...
May 21, 2018 at 8:28pm
[6 replies] Last: oh my bad big mistake,I should have created an ifstream :o totally sl... (by adam2016)
May 2018 Pages: 123456... 19
  Archived months: [apr2018] [jun2018]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.