Beginners - May 2015 (Page 31)

Can't get data into a loop in a loop
 
Hello peeps I just started on C++, and because I have a long history with another (much simpler), but I can still use my knowledge from it. I am currently st...
[4 replies] Last: I guess it is not a problem as you said "loop in a loop". So far as I ... (by FlyingC)
Read lines from the text file but cant do sum of numbers
 
Hi guys I have som issues...I read by lines from a text file which contains numbers(int,double). But it's okay my task is to do sum of even numbers in each li...
[8 replies] Last: i wrote u PM (by ynwa1892)
Need help converting this to h files
 
Hey guys, I don't understand how to convert this rock paper scissors game to multiple files such as header file, cpp file, and main cpp file. I read all the ...
[2 replies] Last: You posted the same question before: http://www.cplusplus.com/forum/b... (by AbstractionAnon)
by Crogn
Confused and distraught
 
Hey, I'm a noob at c++ and have a problem with a few things in C++. I get how to use a lot of stuff but dont understand the theory or the use behind it which ...
[2 replies] Last: Personally, if you are completely new to c++ then pointers and memory... (by Codermik)
Adding random char to empty elements of array
 
Hey, So I am completely new to c++ and having some difficulty finding the info I need. I am trying to fill up the empty elements of an array after filling it wi...
[1 reply] : When a variable is created and not initialised (i.e. giving it a defa... (by Codermik)
How to put string data into an array....
 
How can I make an array of string's ? I am trying to create a resistor color code chart (very, very simple for now)....Once Ive created the program. I want to r...
[5 replies] Last: If you were going down the route of using a class, you could do somet... (by Codermik)
Loading many files with concise code
 
Hi, I would like to ask how to load multiple files/images, without having to write (in extreme cases) thousands of lines of code: For example if I want to cre...
[6 replies] Last: You're right and my solution looks like this: sf::Image ImageName;... (by Bronislaw)
Reference to class is ambiguous??
 
I keep getting 2 errors in my cpp file for the first line: Expected a class or namespace Reference to 'hash' is ambiguous Please help..... //ha...
[4 replies] Last: awww makes sense. Thanks for the clarification. (by macboy49)
Beginner here
 
I have been racking my brain for 2 days trying to figure out what I'm doing wrong. I am getting the error: expected unqualified-id before '{' This occurs on li...
[4 replies] Last: Thanks once again. This is new to me. I am submitting them as 2 separa... (by CreasyBear)
by Ganado
passing subclass object
 
If I have a class that inherits from a base class: struct Base { int g; ); struct Subclass1 : public Base { int some_data1; }; struct Subclass2 : publ...
[4 replies] Last: Okay thank you, I was thinking that it would need to adjust things at ... (by Ganado)
Problem with my code (Extremely new to programing)
 
I've been trying to get this code to work, but when i build and run it, it doesnt matter what name is inputted. As if the "if" statement didnt exist. Would grea...
[9 replies] Last: @vaiandrept4 Can you show the code you used to test, because I don't b... (by naraku9333)
matrix with string
 
It is required to develop a program to do Matrix operations. The program use a defined string format to represent the matrix in the user input and output sect...
[no replies]
Beginner question. Please help
 
What is wrong with this simple program? #include <iostream> using namespace std; int main() { int sample ; int x=0; for (x = 0; ...
[2 replies] Last: After the for loop ends, x is 8 so, cout <<sample ; will try to ou... (by FlyingC)
Taking exit as user input
 
I'm currently writing a gradebook application in which the user would enter grades and I would store them in an array. When the user enters "exit", the program ...
[1 reply] : Pretty sure the problem is line 22, if you enter "exit", line 22 will ... (by Ganado)
How do I get rid of garbage in my output?
 
My output is correct, it gives me the answer I want but it also displays some weird characters (garbage) in addition to the displayed answer. /*Input a li...
[4 replies] Last: Thank you so much! (by shahd95)
Help me fix my errors please!
 
Write a function (and a main() function to test it) that receives an integer N from the main() function, generates randomly a sequence of N numbers between (15...
[1 reply] : Delete the open-curly brace from line 11 and the closing-curly brace f... (by booradley60)
Help Please!!!!
 
I am completely stuck on this problem. Write a class named RetailItem that holds data about an item in a retail store. The class should have the following memb...
[3 replies] Last: A little example... #include <iostream> #include <string> class ... (by Codermik)
by sha92
Virtual Machine!
 
how can I change this program to read commands from a file and execute it? #include <iostream> using namespace std; // INSTRUCTION SET // mn...
[no replies]
Payroll program: incorrectly outputs average net pay
 
I'm a beginner in C++. I'm trying to build this payroll program. It correctly outputs all data (e.g. overtime pay, net pay). However, I'm trying to get it to...
[2 replies] Last: On line 112 you have commented out the accumulator for totalnetpay. ... (by Texan40)
May 2015 Pages: 1... 2930313233... 40
  Archived months: [apr2015] [jun2015]

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