Beginners - November 2012 (Page 8)

Loop Reads data Twice?
Hey there, I'm currently writing code for a small "Mock internet dating service", Everything work's perfectly for reading in the names from file, except that I ...
Nov 28, 2012 at 10:57pm
[2 replies] Last: toum - Thank you very much! (by TaytayB)
Structure with arrays
So this might not even exist but if it doesn't it definitely should. I have 3 arrays of structures that i would like to display their individual elements. I wo...
Nov 28, 2012 at 10:56pm
[3 replies] Last: @ Zaita so you can put the snack in the array and reference them. sn... (by jumperkid400)
by dkjdod
How do I access the data of an object with an object of the same class?
I'm just starting to use objects. I cannot figure out how to pass data between objects. Here is what I have: #include <iostream> #include <sstream> #include <...
Nov 28, 2012 at 10:52pm
[2 replies] Last: There is some other problem. I added in the rest of the program (wel... (by dkjdod)
Alphabetic Selection from a Text File
I am trying to create a database program, which gets its data from a .txt file. My text file is a list of various things (we'll use fruits in this case), and my...
Nov 28, 2012 at 10:46pm
[3 replies] Last: The string class overrides the operator, so you can check the first ... (by pogrady)
Problem with a program concerning an array
I am having trouble receiving the correct results with my rock-paper-scissors program. It is simply stating the player wins every time, and I cannot find the pr...
Nov 28, 2012 at 10:33pm
[1 reply] : In your main(), when you compute who's won you use a single "=" in you... (by toum)
How can I call a function in another class?
I need to call a function that is in another class but I dont know how. void Monster::killMonster(){} void Level::movePlayer(int x ,int y,bool newPos) { ...
Nov 28, 2012 at 10:32pm
[14 replies] Last: okay so I figured out how to get rid of 1 monster and now Im trying to... (by DeltaRed)
Array elements to Integer
Hi guys, i am looking for a function to fuse the elements of an array into a single "int" variable, to make it simple i am looking for the opposite of this func...
Nov 28, 2012 at 9:29pm
[12 replies] Last: And about using my brain, yes, i used my brain doing this, so far it w... (by flavius doroftei)
Game of Nim vs. Computer
Ok, so I had to create the game of nim for a homework assignment. It was for 2 human players. It was pretty easy and everything seems to work flawlessly excep...
Nov 28, 2012 at 9:21pm
[no replies]
ofsteam file name from string
#include<time.h> #include<iostream> #include<fstream> #include<string.h> using namespace std; int main() { string a; int i; char date ; ...
Nov 28, 2012 at 9:14pm
[3 replies] Last: As SamuelAdams said, a / in a file name cab cause a problem. That's be... (by andywestken)
A Final Grade Program
I'm having trouble. I'm not finished my program just yet, but when I run it..I my final grade is 0. I don't understand. I put all number above 0 for the input i...
Nov 28, 2012 at 9:14pm
[3 replies] Last: you have to add double (score/500 * 100) otherwise it output the resul... (by kalicha)
display each word of the sentence on a new
//* Write a program where the user is prompted to enter a sentence * //* or phrase. Then display each word ...
Nov 28, 2012 at 9:10pm
[3 replies] Last: use strtok function that works perfect if you still need help fo... (by kalicha)
File output
In my program it requires a file to be saved to a folder. Since i use this folder so often i want to know how to make a pre-set file path. When i try this code(...
Nov 28, 2012 at 8:58pm
[3 replies] Last: Thank Chervil, it's working now. (by Ghilliedrone)
inherits from class vector?
Is this possible?
Nov 28, 2012 at 8:35pm
[3 replies] Last: #include <algorithm> #include <initializer_list> #include <iomanip> #... (by Catfish3)
by G3PO
Multiplication/Division Tables With Arrays
I'm trying to make a pretty specific multiplication table using arrays and a command line argument. I have my program kind of outlined as far as the functions g...
Nov 28, 2012 at 8:28pm
[1 reply] : Also, with line eleven of my code, I get an error. It says "expected i... (by G3PO)
factorial (!)
how can i create the formula to calculate n!
Nov 28, 2012 at 8:27pm
[4 replies] Last: int main() { int i, n; int fact=1; cout<<"Enter the Value of n:"; ... (by kalicha)
by N0obie
Simple Noob problem, help
Hello everyone, I need some one to help with my noobiness. I'm new to C++ and i don't understand well. I have this code: int main(void) { int dr_typ...
Nov 28, 2012 at 7:29pm
[3 replies] Last: Ok, I solved it! Thank for tour reply, was appreciated. This char *D... (by N0obie)
by Tarkle
Passing Strings
I have this code: #include <iostream> #include <cstdlib> #include <ctime> #include <iomanip> #include <stdio.h> #include <string.h> using namespace ...
Nov 28, 2012 at 7:14pm
[2 replies] Last: Oh my, it was that simple. It works fine now. I was starting to use ... (by Tarkle)
double arrays c++
I am having a really tough time figuring this one out. This is what I have so far but my calculation for expected height does not work for all of the inputs. ...
Nov 28, 2012 at 6:29pm
[1 reply] : You need to display "expectHeight " and not "expectHeight". (by toum)
Array with no duplicate
Hello, I'm having some troubles with the following code. I'd like to generate an array filled with 50 random values, but something's gone wrong: #includ...
Nov 28, 2012 at 6:11pm
[8 replies] Last: @giuscri Here is a way to place a random number into each array eleme... (by whitenite1)
Loop Invariant
So here's the dealio I had a question on my most recent exam dealing with the concept of loop invariant in a function, and I am wondering if the solution provid...
Nov 28, 2012 at 6:05pm
[8 replies] Last: No, that's pretty much what i was asking about, thanks! (by gingertouch)
November 2012 Pages: 1... 678910... 75
  Archived months: [oct2012] [dec2012]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.