General C++ Programming - March 2012 (Page 11)

Procedures and Array, quick tip please.
 
#include <iostream> #include <iomanip> using namespace std; //Prototype void menu(); void inputArray(); void sortNumbers(); void outNumb(); int Q...
[4 replies] Last: #include <iostream> #include <iomanip> using namespace std; //Prot... (by ctittle)
Binary Search Tree - searching func
 
Ive been trying to implement a simple search method for my BST but its always returning false, and when i use cout statements to see where its going, it only ev...
[11 replies] Last: ah, thanks a ton! fixed it. (by shocklightning)
by zakels
help on ignoring space using switch cases.
 
Hi, I'm currently working on a program that deals with parsing a mathematical expression. And I'm stuck. Here is a code. #include <iostream> #include <c...
[4 replies] Last: in my original code I would follow it like this for the period or othe... (by Azagaros)
unresolved token error using template<class t>
 
What i am trying to create is a library that creates an essentially resize-able array via a pointer array, this method is called a bucket list, but for some rea...
[3 replies] Last: this->value = new *_TYPE ; IIRC identifiers starting with underscor... (by ne555)
char Action, else if question...
 
How do i make it to where if i dont enter a valid command, my program does nothing? emample... cin>>Action; if(Action=='1') { cout<<"Confirmed"<<endl; }...
[4 replies] Last: @Invader2010 char Action = ' '; do { cout << "What action ? (1 or 2)... (by whitenite1)
What is the point of this atty function
 
Hi, I need to write a simple crytographic function and in the main file that calls the crypt function I need to write, the last set of statements is an if state...
[1 reply] : It does not matter. It's just to avoid artifacts in the output foo@ba... (by ne555)
Setting dimensions of an array
 
How could I initialize an array by a size given to me by the user? I need to be able to pass this array to a function that takes in int myArray as a paramete...
[1 reply] : Found the answer.... int maxSize; cin << maxSize; int* arr = new int... (by hopesfall)
file input stream troubles
 
Hi, I want my function to generate random numbers, it takes in parameters: outstream object, number of random numbers to generate, and the file to save to. #...
[8 replies] Last: check your code again might have made mistakes (by regonaros)
help with bool class method?!
 
Hello, everyone! I am creating a C++ program that simulates an ATM program. I want to create a method that will check and see if the PIN# entered is correc...
[no replies]
Help with simple in/outfile?
 
I get as far as the output screen with the correct structure but the numbers are nonsense. Help? My program and .dat are in the same subcategory. .dat-> 1 ...
[3 replies] Last: Next to the text-area, or under depending on what view you're in, you ... (by liquidfuzz)
Help with Quicksort
 
In the quick sort algorithm, how would I choose a "pivot"? My assignment is to count how many comparisons the quick sort algorithm makes but I first need to imp...
[1 reply] : Don't shy away dude, just try a place in the array and see what you ge... (by liquidfuzz)
Can somone please help me, Player class wont work for level system
 
here is my code... #include <iostream> #include <string> using namespace std; class Player { public: int health; int exp; int level; Player(...
[9 replies] Last: nevermind i fixed it, thanks alot for your help guys. you're the best!... (by Invader2010)
Inheritance/Derived Classes
 
Hi guys any help appreciated... Assume the existence of a BankAccount class. Define a derived class, SavingsAccount that contains two instance variables: th...
[1 reply] : There's no 'BankAccount' class here. But after I made a dummy BankAcc... (by Disch)
Copying my array
 
How can I copy the contents of one array into three other arrays? Would it make sense to create three other arrays and fill them with the values of my original ...
[3 replies] Last: Then you're expected to actually copy the values. Yes, it's inefficien... (by Athar)
include problem
 
kk so im making a project and i cannot get over this problem. Visual studio 2011 keeps throwing: 1>e:\fusion gl\fusion gl\accessories.h(8): error C2143: syntax ...
[13 replies] Last: The current file has about 17 other classes that are built around how... (by ne555)
How to initialize array using user input?
 
How could I create an array of size n, where n is a int given by the user? Something like this: int MAX_SIZE; cout << "Enter size of array: " << endl; cin >...
[1 reply] : How could I create an array of size n, where n is a int given by the ... (by Athar)
Need help with a do-while loop!
 
Solved.
[4 replies] Last: This question is: Using a do-while statement, write, compile and run ... (by Moschops)
program shouldnt handle out of range data
 
please explain how to solve this,this is the comment from instructor for point deduction,thanks. -1 pt for readArray() handles the out of range data (input <-...
[no replies]
by mowicz
Deleting substring(s) from a string
 
Hi there. I have a school project to make my own pseudo string class and one of the overloaded operators has to be a unary minus, which is to remove all of th...
[3 replies] Last: Compare letters in main string with letters in substring to find a mat... (by Moschops)
variables in classes?
 
i have been told that declaring variables in a public function in a class is bad. is this true, if so why? the reason i ask is cause i hate having to declare a...
[5 replies] Last: for efficiency and security (by Eyad)
March 2012 Pages: 1... 910111213... 49
  Archived months: [feb2012] [apr2012]

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