Beginners - May 2016 (Page 10)

print_avg only reading in first element
 
So I'm trying to read in an array of years and print how many of those years are over the average. I know the problem lays in my print_avg function but I can't ...
[2 replies] Last: You're only checking the first element of your array so unless the fir... (by jlb)
names from array
 
This is the output i want outputted after information is inputted. instead of my code that skips the 1st name info. Day of Week: Wednesday No of painters: 2...
[3 replies] Last: You're missing the point. Your class should represent ONE building or... (by AbstractionAnon)
by Jaif
Bubble sort problem.
 
Hello, the program works but the problem is the sorted numbers doesnt appear. All it brings up is 1 and that's all. Where is the error? #include <iostream> ...
[5 replies] Last: Ok, nevermind, got it myself ;D (by Jaif)
while loop problem
 
Hi guys,I want my program to exit while the var TheChoice is not = to 4 but what I find is after I'm well into the loop when I hit 4 the loop does not exit,it c...
[2 replies] Last: yeah that was driving me crazy something so simple haha (by adam2016)
Is programming going to be a tough journey?
 
Hey guys, I'm not asking any sort of coding question this time. I want to know from all of you experienced folk here who seem to understand everything if I am g...
[3 replies] Last: I'm the same age as you and we have a lot in common! I really want to ... (by Edi12)
automatic web starter
 
I am new to programming with C++. and i want to make something that helps me at the start of the schoolday. I spend days on this problem, but cannot find the aw...
[3 replies] Last: What you can't type on the command line, you can't feed to system . ... (by cire)
C++ code for area of triangle, compiling but not working
 
This program is to find the area of a triangle using three vertices. I have used Heron's formula to do this. The program compiles but I get these warnings in th...
[1 reply] : line 49, you're not actually calling the function. Try change it to: a... (by liuyang)
void functions and other functios
 
Write your question here. hi everyone. i have to code a program that contains 2 functions and prototypes.A void function and the other is ask for data functio...
[no replies]
Homework Problem
 
Hey all! I am trying to get one of my homework problems to work, but something is going wrong with it. Would appreciate any advice you guys can give me on it...
[3 replies] Last: Sorry, but your original lines 1-33 are ok. On the new attempt: * Y... (by keskiverto)
Floating point error
 
'domain abnormal program termination is appearing on the user screen I got stuck in this simple program #include<iostream.h> #include<conio.h> #include<ma...
[2 replies] Last: Thanks a lot (by Sonu 123)
Repeated Words - Bjarne Stroustrup Book
 
Edit: after re reading this post a couple times I discovered why "she" and "good" are not repeated. It's because she is capitalized the first time and good has ...
[1 reply] : The strings "She" and "she" do not compare equal (case-sensitive) Th... (by JLBorges)
Easier way to do this?
 
I want to read a letter from the user that is between a and j including a and j. Here is my attempt: if (userInput != 'a' || userInput != 'b' || userInput !...
[4 replies] Last: Thank you very much guys! (by MultiMedia)
Vector of vectors - why doesn't this work
 
So suppose I want a vector of vector<int>'s, and fill up position with the number 5. Here's the code for that: #include <iostream> #include <vecto...
[1 reply] : The type of the expression std::vector<int>().push_back(5) is void ... (by JLBorges)
by norcal
Linked Lists help
 
How do I modify this program to track the numbers guessed by the user using a linked list. So basically, i need to keep track if someone already guesses a numbe...
[2 replies] Last: Well this is a homework assignment and I kinda have to use a linked li... (by norcal)
loops conditions
 
Hi guys I thought that when using a loop or a test condition I thought you could only test if a condition is true or not for example if(x == 20) or while(y==tru...
[2 replies] Last: correction: operator>> returns a REFERENCE to an istream object. (by Arslan7041)
Logical operator problems when entering integer to char variable
 
Can somebody explain why it is that problems arise here. Fx if I type a=1 I get "More" as an output and if a=2 the output is also "More". #include <iost...
[1 reply] : The input expected is just a single char, so if you type "a=1" as your... (by Moschops)
try catch unexpected result?
 
hi guys so when I enter a valid number that is not 0 the try and catch block still gets called and it prints cannot divide by zero even when x and y are not equ...
[8 replies] Last: Thanks guys that makes sense much appreciated (by adam2016)
play sound
 
I managed to use playsound in visual studio and I used a code which I found in an old forum the program only run when I edit project properties =>linker=>input=...
[10 replies] Last: I downloaded a wav file and it worked =D sorry for this stupid mistake... (by mariam maher)
by pyos
2D array with strings and int with 'cin >>'
 
I am trying to write an array where the user inputs three years worth of sales data by month. First issue, I am inputting all three years in month one as opp...
[no replies]
by wolfv
Circular dependency linker errors
 
I am stuck on the second example. I appreciate any help you can give me. In the first example, two classes call each other. It works as intended. Example 1...
[4 replies] Last: The following code has the .cpp files #included in main, and it works.... (by wolfv)
May 2016 Pages: 1... 89101112... 36
  Archived months: [apr2016] [jun2016]

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