Beginners - October 2013 (Page 32)

Spot the mistakes
 
Can anyone help me in spotting the mistakes in this program? #include <iostream> #include <ifstream> using namespace std; int main() { ifstream.out...
[3 replies] Last: Ah yes, didn't see that. (by Stewbond)
Why won't this code compile?
 
I'm trying to compile this sample program from AntiRTFM's C++ tutorials and it gives me an error stating that it cannot perform an else statement without a prev...
[4 replies] Last: You can use any editor you want, syntax won't change. Just read that a... (by vasilenko93)
C++ equivalent of Java's length
 
Java int numbers = new int ; for(int i = 0; i < numbers.length; i++) { //do stuff } C++ int *numbers; numbers = new int ; for(int i = 0; ...
[3 replies] Last: #include <vector> int main() { std::vector<int> numbers(5) ; ... (by JLBorges)
What is wrong with my program?
 
Basically, I have to find the ranks of baby names in the top 1000 list. When I run it, it is weird and shows negative numbers. #include <iostream> #incl...
[3 replies] Last: You'd better post _what_ exactly you tried. You see, I'm not good in t... (by rodiongork)
flow chart
 
plz tell me how to make a simple flow chart for gcd(greatest common deviser)? _
[1 reply] : Simply type "gcd flow chart" in google and you'll get several samples ... (by rodiongork)
by kay19
Validate user input
 
The purpose of this code is to extract a double from a String. Well, I'm not sure if i'm progressing well, but it's too make the user input any number such as ...
[2 replies] Last: Alright thanks for the reply, yeah I was just experimenting and kept c... (by kay19)
Even and odd numbers
 
I have got the programs to print out even numbers between two numbers. May anyone tell me how I can print out odd numbers in that while loop? //Declare a...
[1 reply] : Odd is the opposite of even so just throw in an else statement. ex: ... (by giblit)
Read info from file into arrays
 
Need to read a file and send the name of the monkey and amount of food (in pounds) by day to two different arrays. Not sure how to go about adding a name to one...
[no replies]
Even numbers?
 
Having the user enter in two numbers and generate even numbers between those numbers. In my code here, when it performs, I usualy get two extra numbers. For ins...
[2 replies] Last: Yup that helped :D Thank you :) (by fahmankhan75)
Loops
 
I have to create a program that allows the user to input numbers and then totals the arithmetic mean. I also have to calculate the number of significant digits...
[1 reply] : Please use the source code format, makes it a lot easier for people to... (by Uk Marine)
input/output file
 
Write a program to compute numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the f...
[no replies]
Intializing error
 
error hour is not intialized but i intialized hour to zero #include<iostream> #include<conio.h> #include<stdexcept> using namespace std; class Times ...
[1 reply] : At line 33 you declared a new variable: int hours=hours-12; ... (by Chervil)
Event controlled error
 
Hey whats up, I'm really new and really a beginner to this so sorry if this is a really dumb question but... I'm trying to make a program that loops and calcula...
[2 replies] Last: Thanks! I was so caught up with the programming that I didnt do the ma... (by wcsjunior)
Use of Functions in Calculations
 
Hello. I'm experimenting with functions and cannot get this program to run. I'm receiving an error: fatal error LNK1120. I'd appreciate any help. Thanks ...
[3 replies] Last: Thank you very much for your help, admkrk and Locien. I have fixed the... (by Diexode)
How to int from string?
 
I need help in doing this for class. So, lets say a user inputs a string "1234" how would i be able to add 2 to each number individually? so the it would look l...
[1 reply] : Think of a string as a char array with 4 elements (in your example). T... (by admkrk)
by aju33
Problem Function Calling
 
Hello, I've been studying function calling lately. I've written a program to ask for two variables, b and c, from the User, calculate res (resistance), and pr...
[2 replies] Last: Locien, Thank you!!! It runs successfully! I knew it was going to be... (by aju33)
by ephekt
Exception Haldling
 
I have been asked to add an exception class to the digital time problem that excepts two arguments an int value and an error message. I think I have a problem w...
[2 replies] Last: I just figured out the problem. The other functions that take DigitalT... (by ephekt)
Text file word by word into Link List
 
I'm having an issue within the first while loop, it prints out 1 then crashes. Eclipse doesn't give me any errors. It pops up a windows alert box saying Assignm...
[4 replies] Last: i tweaked my code a little bit and it prints semi-justified. The only ... (by samerman07)
Help with homework
 
Can someone please help me with this homework? I don't know where to even begin. I don't want someone to do it for me, just tell me how I should do this. Thank ...
[2 replies] Last: Duoas offered some good direction here http://www.cplusplus.com/forum/... (by closed account D80DSL3A)
Error in this code? [c++]
 
Can anyone find the errors in this code? #include <iostream> using namespace std; int main() { double number, half; cout << "Enter a number and ...
[4 replies] Last: double is a built in type (by Superdude)
October 2013 Pages: 1... 3031323334... 86
  Archived months: [sep2013] [nov2013]

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