Beginners - November 2014 (Page 8)

Input Error causes infinite loop. Suggested fixes causing program to break.
 
Hell everyone, first time posting here. I decided to get a head start on my Final for my intro to programming class. However on the home stretch I have encounte...
[8 replies] Last: Happy coding.. (by shadowCODE)
by bpro
Calendar still displaying when parameters are invalid
 
Here's what I need to do: If the start day is not in the range 0 to 6 inclusive or if the number of days is not in the range 1 to 31 inclusive, the program sho...
[2 replies] Last: Thank you @whitenite1, got it working! (by bpro)
how to read whitespace using infile from a file in c++?
 
i have to make a program which reads each chaacter from a file and using the caesar cipher if the character is an alpha it should be shifted by the user specifi...
[8 replies] Last: thank you!! the program works perfectly now. (by idknuttin)
by Scizor
Seeing if letter was guessed already or not
 
Hello, with this binary search I'm trying to make sure that the user doesn't guess a word twice in my hangman game. It seems to be working correctly except for ...
[2 replies] Last: Ahhh thankyou kind person! I re-initialized numGuessedLetters to 1. It... (by Scizor)
Double being rounded?
 
I'm using cpp.sh online to mess with some code, for some reason this is rounding to num to 3 instead of the actual value 3.4. Is this something I am doing wron...
[2 replies] Last: Thank you JLBorges! (by bulba5aur)
2D Arrays
 
Hi, I have almost no clue how to use a 2D array.. The start of my project requires a 2D array filled with a private member char array of spaces 24rowsx60cols. A...
[4 replies] Last: int x = 24; int y = 60; char c = ' '; These names have external lin... (by JLBorges)
How do I create an array of objects?
 
I've written the following program. I want to create an array of objects of the following class. How do I create the array & take input into the object and pass...
[3 replies] Last: In first case you need to provide default constructor for your class. ... (by MiiNiPaa)
Dynamic 2D array with classes; program crashes after destructor
 
matrixData is a 2D array and is a member variable of the class matrixtype. It is a pointer to a pointer. I saw in debugging mode that my program crashes afte...
[6 replies] Last: Thanks! I fixed operator<<. I actually had an overloaded operator= and... (by imStillPondering)
by mstru
Population program, loop issue (not calculating correctly)?
 
Hey guys. Everything is working great here except when the program outputs the calculations, the "newpopulation" outputs the same exact value as the original in...
[6 replies] Last: Yes, that was indeed the problem. Your line 63 worked much better with... (by mstru)
Building a Simple Template Function
 
My assignment is to write a template function called total() that keeps a running total of the values entered. It takes as an argument the number of values the ...
[2 replies] Last: Thanks very much! Very helpful. Still having issues, however. I kept... (by danpants)
fstream object complications
 
Can someone please explain to me why when I initialize this array of structures there are additional characters that I have not inputted in the text file?? F...
[4 replies] Last: thanks I see the mistake. Should be: for (count = 0; count < 10; coun... (by student89)
...asd
 
aaaa
[2 replies] Last: While(1) is an infinite loop. (by fabtasticwill)
by zanne
Need help, with list
 
Can someone help with home work? I'm beginner, i searched whole internet and couldn't find right answer. :/ So the task is : The database, which can perform so...
[no replies]
QuickSort Problem !!
 
I don't know why the recursion QuickSort isn't execute. #include<iostream> using namespace std; void input(int *a, int n) { for (int i = 0; i < ...
[1 reply] : you have not written the partition function. http://mathbits.com/MathB... (by anup30)
by thor36
Error when reading from text into double array
 
Greetings all. I have a text file named data.txt . data.txt contains "double" numbers, one in each line. My attempt is to: 1. check how many lines are in data.t...
[4 replies] Last: Thank you, that was it. I didn't know about opening and closing files ... (by thor36)
Doubt On Abstraction and Encapsulation
 
From my point of view Encapsulation: we Bind the data and methods to be executed on that particulat data into one unit known as class.so we r not allowing the...
[no replies]
Problem with for-loop
 
Hi everyone I have to created an array in which I store the coordinates of n target (n is determinate when the user calls the program). Than I want to compute...
[1 reply] : Line 7 is not valid C++. array sizes must be known at compile time. (by AbstractionAnon)
Two equivalent lines of code produce different results
 
Hey guys, I'm having a slight mindf*ck here. To simplify my code: #include <iostream> #include <cmath> using namespace std; double INT_LENGTH(int a){ f...
[7 replies] Last: I ran into the float issue using pow() with int variables. . .not a go... (by PCrumley48)
Book suggestion to understand Tokens
 
I'm reading "Principles and Practice Using C++" chapter 6, it's about using Tokens and as if the concept of Tokens were not already confusing the whole chapter ...
[6 replies] Last: Thanks everyone.... found this on Bjarne website: Token get_token() ... (by BigRedMachine)
by Scizor
Mask and demask word
 
Hi guys, thanks for taking the time to look at this. I'm working on a hangman game and have masked the word that the user needs to guess(code below). The fact i...
[1 reply] : You create the mask once after the word is determined and before the g... (by coder777)
November 2014 Pages: 1... 678910... 65
  Archived months: [oct2014] [dec2014]

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