Beginners - March 2017 (Page 11)

Terminating a the program whenever the same input was entered.
 
I'm trying to run this program whereas if i input the same number previously, it would terminate. I can't figure it out. Can anyone tell me where i went wrong o...
[2 replies] Last: Thank you so much, sir! (by theansweris3)
by mrwhit
Beginner. Need help.
 
I am trying to write a program that will read a 100 element array and output the mean, median, min value, max value, and std deviation of the 100 elements. I ca...
[3 replies] Last: Hello mrwhit. Changing the return type of the proto type does not fix... (by Handy Andy)
Decimal to binary conversion using a function
 
Hello everyone! Hope you all be fine.. I m trying to convert a decimal number to binary using a function. I tried to save the result into an array but the probl...
[2 replies] Last: #include <iostream> #include <string> using namespace std; string in... (by lastchance)
Expected Expression error on an "else if" clause.
 
I have tried everything I know about fixing "else if" clauses. Can someone provide some direction on what I may have messed up in the "else if" clause or what m...
[4 replies] Last: This is probably beacuse you have the else if statement inside your if... (by sheel)
Function to sort array of pointers to an array?
 
Just as the title suggests. I am absolutely clueless and cannot not get anything to work in my favor. I've been trying for a few hours. I am supposed to make ...
[6 replies] Last: The algorithm compares all elements with the following (i.e. + 1...) ... (by dhayden)
Undefined Reference to 'WinMain@16'
 
As the beatles once sang, "help, I need somebody, Help, not just anybody, Help, you know I need someone, HELP". I'm trying to break my programming virginity ...
[3 replies] Last: Hi Thank you both for your assistance with this. Changing the m to lo... (by GregMoss)
Vector problems
 
Hi, I'm creating a title screen for my game. The title screen will include 3 fields, set up as such: START GAME HELP & OPTIONS EXIT GAME Now, there is one sele...
[5 replies] Last: You are correct, fixed this last night too. Thank you for your help, i... (by MatiasMunk)
by csharp
To check for prime number with FOR loop
 
hello all, I am trying to write simple program to check entered number whether prime or not. I haven't written any c++ program for a while, but did some sear...
[3 replies] Last: I forgot to mention that the program also shouldn't quit and should b... (by mbozzi)
How to make function return pointer to vector
 
Not sure if I'm going about this the right way. I have four vectors (card Hands) of 13 (cards) objects each. I want this switch statement to be converted i...
[6 replies] Last: Whoops! was in fact a typo lol. It is #include <vector> . No other ve... (by kingkush)
Function not working as it should
 
Hi all, could someone with a kind heart help with this program? Question: Write a function NumberOfPennies() that returns the total number of pennies given...
[2 replies] Last: thanks @gunnerfunner, I finally figured it out (by mikofat)
Need help with simple code.
 
Roll two dice repeatedly until you roll the same total value twice in a row. State how many times it took. I don't know what to put inside the while to stop...
[5 replies] Last: Hope i explained it well enough. I should have used a bool for the whi... (by kingkush)
Created class not passing by reference
 
I have a couple created class that I can't get to pass by reference. string parseTokens(queue<token>& foundTokens, datalogProgram& _program); Then ...
[4 replies] Last: Think I figured it out, thanks for the advice and feedback! (by closed account oEwqX9L8)
Sending all output to a file
 
I am trying to get all of my answers/numbers to be outputted to my .txt file, but I am only getting the last value in the set for each of the values, where did ...
[1 reply] : You are only writing to the file on lines 46-48. If you want to output... (by Peter87)
how to DON'T print empty array cells
 
Hi everyone! Is there any way to print out only the "full spaces" of the array? Basically I have a txt file with some that looks like that: Order: ...
[4 replies] Last: Hello lapolis, I have been playing with a struct and this is what I c... (by Handy Andy)
Breaking and returning to main / restart program.
 
When i input a a negative integer, the it does break which is what i want but when i input a positive integer, it still breaks. Any workarounds? If so, i also w...
[3 replies] Last: if you want the program to restart put the portion of code that you wa... (by kingkush)
overloading << and >> operator and converting types during file writing and reading
 
Hello everyone, I am working on an assignment. Brief Specifications: Class Song Data members: Title(string), Artist(string), Length(Time, an object). ...
[4 replies] Last: Thanks all. I wonder why we could not just use chrono instead of makin... (by longberns)
PLEASE HELP ME! TIC TAC TOE
 
Please, I've been dancing around this code for probably 12 hours and I cant freakin crack it. I NEED this code done TONIGHT.... I'm creating tic tac toe for my ...
[2 replies] Last: Take a deep breath. You're actually very close to having this right. ... (by dhayden)
The sum of two numbers
 
I am writing an if else statement where i need to see if the sum of two numbers in equal to, greater than or less than 100. I put in this code down below, and w...
[3 replies] Last: @joe864864, i think you missed < for > if ((a + b) < 10... (by longberns)
How do i need to learn C++?
 
Hi, im a beginner in C++, i learn it for more that 3 months now, but i feel like i dont know nothing what i learned from those 3 months and my question is, how ...
[5 replies] Last: +jonnin +kindkush +Kourosh23 Thanks for all the tips, it really means ... (by CosminPerRam)
logic error and it not reading well
 
how to check if the user key in the correct pin number? it doesn't take the data from the txt file. #include <iostream> #include <fstream> #include <iomani...
[3 replies] Last: Start by reading from the file into the array. After that, the program... (by Chervil)
March 2017 Pages: 1... 910111213... 36
  Archived months: [feb2017] [apr2017]

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