Beginners - December 2012 (Page 56)

THE 0?
 
Hi; My input file is this Andy 15 Bob 17 Cathy 16 David 17 Edward 16 Freda 14 I keep getting an extra 0 in my array which is really...
[8 replies] Last: OK so the ones that appear in my list from bottom to top are the order... (by jlillie89)
forgot the &?
 
I haven't seen this error before: //header #include <iostream> using namespace std; #ifndef XYZ_H #define XYZ_H class XYZPoint { public: XY...
[14 replies] Last: That's great. Except a point isn't a distance. Especially a point wh... (by cire)
by G3PO
Battleship game.
 
I'm looking to make a two player battleship game. I'm not going to worry about playing the game with a computer, that would be even more work. Basically, I need...
[7 replies] Last: Meh.. ok, so it's about a 95% solution. There's a tiny logic bug wher... (by HellfireXP)
Pointers
 
I have a program where Employee is the base class; Salaried class and Hourly class are derived from the Employee class. I have to create two employee pointers ...
[2 replies] Last: Thanks AA! (by dudeman007)
Dynamic memory allocation for an array
 
Hello all, I am having trouble with this assignment. I do not want anyone to do it for me just answer a couple of questions. This is the question: Write and ...
[no replies]
by Oswld
Finding shortest path!
 
So this is driving me crazy. I'm coding the Dijskra algorithm to find the shortest path on a graph from a vertix v to a vertix nv and It's just not working, I h...
[10 replies] Last: I get you, because the temp will not be there anymore after you leave ... (by Oswld)
Comparison
 
Hello everyone, I am writing a program that will load a text file containing the periodic table of elements into an array of struct's and then use the data to ...
[3 replies] Last: Yea, I already got it figured out a few hours after I posted this, I c... (by Kseidel)
Searching through a file and appending
 
I've been working this problem for a while. I'm trying to search a file for a name, and if it finds that name, it just ignores it and continues the program, but...
[2 replies] Last: Never mind, I figured it out on my own. I ended up with this: void ... (by JacobA5)
Non-standard compiler??
 
I am working out of a book that claims that their examples comply to standard C++. There is a particular line of code in an example in their book that is genera...
[5 replies] Last: Third edition is from early 1998, when the first revision of the stand... (by Cubbi)
HELP Simplest data file into 2D array code
 
Hi. Ive searched everywhere on this form for the last 5 hours for a simple read data file into a 2D array code to follow but none are helpful! So I decided t...
[no replies]
by Jelle
Problems with || and &&
 
Hello there. I am new to c++ but have been coding pawn/small for a while. I am trying to just make a simple calculator which divides, but I can't get the ...
[8 replies] Last: It makes way more sense now, after reading your table about true and f... (by Jelle)
-life after bucky- As i am teaching myself, how could i know what the next thing to learn is to help me learn the next...
 
I need to know what to learn next so i can go onto the next thing and so on. Being taught by someone who knows how you should progress through your subject is ...
[no replies]
Reading Integers from Txt file into an array
 
This is from the 8th Project Euler problem. I'm having trouble getting the list of 1000 numbers into an array from a file. Whenever I run the program, it sho...
[2 replies] Last: When I replace inText >> holdNumbers ; on line 29 with holdNumb... (by bickelz)
Swap function failure
 
Hello all! I am trying to write a program that takes its input from a file that has a list of people's names, ages and genders. My problem is in my sort functio...
[8 replies] Last: With your suggestions, I plugged everything in and it worked perfect. ... (by mlholder)
Issue when creating a pointer class
 
Hello, I created my own vector class so store data read in from a txt file. My vector class is its own, in its own namespace, and I am making a CSV reading c...
[no replies]
by eddyq
How do I get preprocessor output?
 
How do I get preprocessor output with Code::Blocks C?
[2 replies] Last: C compilers first pre-process a C file to resolve all #define's. Then ... (by eddyq)
Object container
 
Hey guys I'm wondering what container class to use in order to be able to update my objects, I don't have to deal with deletion or memory leaks. What I'm famil...
[1 reply] : You can use vectors. You need to dynamically cast to a base class: ... (by Stewbond)
Simple problem with declaring scope
 
#include <iostream> using namespace std; int main() { cout << "How much money do you have?"; cin >> cash; cout << "How much does the product ...
[2 replies] Last: Hi! I'm a beginner in C++ as well but I think I can help you out with ... (by Momojams)
by Gorgah
2D array that avarages grades
 
Write a program that reads input file ¡§grades.txt¡¨ to EOF and inputs a 5 digit student ID number followed by 6 test grades then another 5 digit student I...
[no replies]
Vending Machine Struct Array Functions
 
Hi guys, I'm trying to get this program to run properly but it just doesn't want to accept the user input and quit the loop, or it accepts the input after sever...
[4 replies] Last: It happens when I run through it a few times and more frequently when ... (by Sylevane)
December 2012 Pages: 1... 5455565758... 65
  Archived months: [nov2012] [jan2013]

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