Beginners - July 2012 (Page 8)

Source code Error
 
Hi all! Why doesn't my code work? I want it to reverse the content of the passed array. The code: #include <iostream> using namespace std; void rever...
[8 replies] Last: Thanks all for the help! I solved it by using a struct (sorry for all ... (by Fransje)
I/O Streams and Data Files
 
Hi i was wondering if there was a method to count the number of times a certain word is encounter in a data file. For example, if i had the following data file ...
[1 reply] : std::count from the header <algorithm> (by viliml)
by mgbuhj
program won't write out to text file
 
I'm trying to make a program that reads emails from a text file ("fileContainingEmails.txt"), prints them on the console, and then writes them out to a differen...
[5 replies] Last: So I changed while (true) to while(!fin.eof()) , but to no avail. ... (by mgbuhj)
Assistance with functions
 
Need help writing this program where main calls a function to ask user for set of numbers and then calls another function to calculate those numbers and finds t...
[1 reply] : Hi there, That's pretty close, but the problem is in your middle() fu... (by closed account o3hC5Di1)
text file statistics help (1,2)
 
This is a homework assignment and I am stuck and would appreciate any pointers or help on this. I have to write a code that will allow the user to type in the t...
[24 replies] Last: Thanks, I finally got it. When I used that it was displaying the chara... (by BroncoAG)
pointer to array element or direct element
 
Which way is more efficient; using a pointer to an array element or directly giving the array element? I ask this because ppl say my code is bad so I want to fi...
[2 replies] Last: So, in that case, a pointer is completely useless. I wonder why we wer... (by TheBestHacker)
This pointer
 
hi, I having trouble with the this pointer what exactly is it used for? Is it used only for argments with same method member names like this code? //File e...
[1 reply] : No, this is used whenever you need a pointer to the instance, be it ... (by Athar)
SDL controllin sprite moving speed!
 
I want to know how to control the moving speed of a object. My thought was to have the move function to be executed every x millisecond, but well I would need ...
[6 replies] Last: Line 16 of your method should be x -= moveSpeed; , right? Looks like... (by Lowest0ne)
Confused by over complicated example
 
Aloha Everybody, I'm working on an exercise with the intention on practicing vectors. The point of the exercise was to make a program that would check to se...
[3 replies] Last: It's an exercise. It's meant to demonstrate things to you. This one de... (by Moschops)
STL Lists.
 
Hi, im doing an assignment where we have to read XML documents, put that data into a container of some kind and then draw it onto the screen. I was told by my t...
[1 reply] : The iterator needs dereferencing (or should I say, the * operator): (... (by Lowest0ne)
by mgbuhj
subprograms
 
I'm supposed to rewrite my quiz program so that the code that allows it to output the questions, allows user input for the answer, and then notifies the user if...
[no replies]
by mgbuhj
event controlled loops & functions
 
I made a program that generates addition problems, and the user enters the answer in and it notifies the user whether it is correct or not. Initially my progra...
[1 reply] : Hi there, Although it's best to post your compiler errors along with ... (by closed account o3hC5Di1)
I/O stream and data files
 
Hi im trying to input an integer from a text file that contains a word first then the integer im trying to save into a variable. for example, if i have a text f...
[2 replies] Last: thank you Moschops that really helped. (by johnny92)
List a lot of exercises for "control structures"!!
 
I'm practicing the "loop" but I can't think of any D: I did the grade one...What else? I need exerices on all the rest of the control structures execpt if/else ...
[1 reply] : Find all the prime numbers below 100. (by Moschops)
my C++ pirate game [judge] (1,2)
 
http://pastebin.com/LYKD3Aj7 i think I did but but I need someone to judge it before I sell it on hackforums. my friend says i should adopt his coding style, b...
[38 replies] Last: TheBestHacker I'm not sure if you're a troll or a ret... errrr... very... (by Abramus)
by mgbuhj
program loop doesn't work correctly
 
I'm trying to compile a looped program that calculates how far a ball bounces off the ground, but I want it to break out of the loop once the distance becomes l...
[6 replies] Last: if ( height > 0.5) height = height / 2; cout << "location i... (by ThangDo)
Help with encyrption or string hiding
 
I've been learning c++ for a little while on my own so far and i plan to learn in college and have a future in programming. I am new still and being that i have...
[12 replies] Last: well thx for the help and i will continue to take more and continue to... (by snaxpax)
Caesar Cipher 99% done
 
I am almost done with this code. I am just having trouble with one encryption. When I decrypt "TekwbqiQtqci" with a key of 42 it decrypts as "DU[gRaYAdaSY" inst...
[5 replies] Last: thank you so much this helped me a lot!! (by Hart88)
by mgbuhj
calculation from text file
 
Hello, I'm trying to create a looped program that collects celsius temperatures from a text file and does the calculation for all the numbers to be transformed ...
[1 reply] : Unfortunately, getline() doesn't let you put that value into a doubl... (by QWERTYman)
Text Game Inventory/Error
 
Okay so I'm making a text based game. I decided to put an inventory in using boolean variables. When I run the program it says that "a function definition is no...
[1 reply] : Because functions can't reside within any other function. You need to ... (by Volatile Pulse)
July 2012 Pages: 1... 678910... 54
  Archived months: [jun2012] [aug2012]

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