Beginners - November 2013 (Page 78)

Reading Text File
 
I'm having trouble reading a text file and putting the information on that text file into the console output. I THOUGHT my way about the program was correct..bu...
[2 replies] Last: #include <iostream> #include <string> #include<fstream> using namespa... (by Pured)
by sig226
Trouble with arrays
 
I need to write a program that reads a file, then puts the information into an array. It must then calculate the average, standard deviation, and the min and m...
[3 replies] Last: void compute_max_min (int theData , int& dataSize, int& iCurrMin, int... (by Tiger58)
declaration int *arr;
 
Assume the declaration int *arr; Which declaration dynamically creates an array of 35 integers? Circle one. (a) arr = new int ; (b) *arr = int ...
[no replies]
by Anna22
Random number for value in an equation
 
Hello, My code will compile, but will not populate the table, or it runs an infinite loop. This version shows the empty table. The infinite loop happens wh...
[2 replies] Last: We got it! Excellent! Line 38: Using range seems a lot more straightf... (by Anna22)
Creating a thread with #include <thread>
 
Hi I want to create thread, but I always have some compiler errors. Please help me. I have a class called bacteria, here is the simplified class declaration...
[8 replies] Last: However I get a runtime error now unless I call thread_bacteria_life.... (by Cubbi)
Im making a game (1,2)
 
let me just say that this is for a project so please dont outright hand me an answer. right now the code is not a game its still a work in progress, I recently...
[36 replies] Last: I've spotted another problem on lines 51,57, and 62. Where it says "in... (by CplusplusAcolyte)
Setting spaces with loops?
 
Hello there, I have a problem, I have been trying really hard to write the following program for my Programming class: Write a program using a single ‘for’...
[6 replies] Last: replace setw( steps * 5 ) with a for loop :P for( int i = 0; i < st... (by giblit)
Craps game of hell
 
I bet you guys have already seen this assignment around here: So here is the program statement (1) One of the players goes first. That player announces the si...
[5 replies] Last: @Last post: As Mats said, just remove the quotes. Line 43: This line ... (by Albatross)
by wirowi
loops, loops, loops
 
It's supposed to find the numbers for which their digits' sum equals their digits' product. For example, taking the number 123: 1+2+3=6 and 1*2*3=6. So the prog...
[4 replies] Last: setw() is part of the C++ <iostream> library that allows you to fo... (by yulingo)
How can i convert this while statement to do while?
 
Write your question here. int number, product = 1, count = 0; cout << "Enter a whole number to be included in the product" << endl << "or enter 0 to end...
[3 replies] Last: There's always the easy way, which involves copying the while loop int... (by CplusplusAcolyte)
While loop help
 
Ignore the extra things in the header, as this is only a fragment of my code. I am trying to create a game of rock paper scissors and I NEED have the input as a...
[2 replies] Last: Thanks much for the help :) (by bwilfong3)
Void return?
 
Hi, I'm trying to create a function that works in a way like a void, where you have to call it for it to execute but I found that you can't return in a void, he...
[4 replies] Last: EDIT: I should really read other replies..... yulingo just said the ... (by Disch)
bug in goto command
 
Hi everyone, when compiling my program, it works, but something is going wrong. Whenever it gets to a certain section in my program, it skips the goto command....
[1 reply] : Three words: don't use gotos. -Albatross (by Albatross)
Help with randomizing bunny program movements
 
Hi, I have been working on the bunny program excercise from forum topic http://www.cplusplus.com/forum/articles/12974/. I would post this question there, but...
[1 reply] : That was definitely a lot you asked us to do, BUT I did it anyway beca... (by Albatross)
dangerous of code
 
what is the dangerous in this code? I'm talking here about pointers . #include <stdio.h> int *pPointer; void SomeFunction() { int nNumber; nNu...
[8 replies] Last: cire .. do u mean that when the SomeFunction returns , the variable n... (by cire)
Help Simulating Software buffer scenarios
 
Hi... So, I'm taking an Architecture & OS class and wasn't really prepared to do any programming for it, but I have a lab that requires me to write a bit of sof...
[no replies]
by Nebur
Trouble with a program! Help apreciated :)
 
Hey guys, I am having trouble doing the following program: Consider a sequence of words formed by letters. The words are separated with dashes, which can app...
[2 replies] Last: It worked! I have no words to describe how grateful I feel towards you... (by Nebur)
Need help understanding passing pointers
 
I am new to C++, and I am reading the book "Beginning C++ Through Game Programming", by Michael Dawson (2011). The book is wonderful, it really helped me under...
[3 replies] Last: @HEDO4EJIOBEK: Yes, I did forget the ")" at the end of the first line,... (by lightbulb101069)
rock/paper/scissors
 
This is what I have as a start to my R/P/S game. The only parameters are:You must use the rand() function and a switch statement in the random selection of the ...
[7 replies] Last: I've played around with rock paper scissors concepts in C++ earlier on... (by CplusplusAcolyte)
by enemy
how to stop the for loop at certain i value
 
Hello! Please, how to stop for loop at the certain i value and embedd do while in there? Many thanks! #include<iostream> using namespace std; int main(){ ...
[3 replies] Last: I think he means like this int count = 0; for( i = 0; i < 10; ++i )... (by giblit)
November 2013 Pages: 1... 7677787980
  Archived months: [oct2013] [dec2013]

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