Beginners - April 2016 (Page 42)

Storing Class members inside an array
 
I'm trying to store class members inside an array. I can't use vectors yet. So how would I do it? In terms of syntax classes look similar to structs so I tri...
[5 replies] Last: Actually, when I try to add a constructor to it, I get an error that i... (by joshuatz)
Array function help
 
I am writing a program for a lottery array function thing. I am getting this error in one of my functions and I have no idea what I am doing wrong. Please help....
[2 replies] Last: oh wow thanks. you sir are a gentleman and a scholar. (by idkterrible)
program in C++
 
Problem :GPA (Graded Programming Assignment): It is of 10 marks. Students need to write some code and submit it. There are 3 test cases, against which the stude...
[2 replies] Last: variable to store totals in += variable you want to total (by miah612000)
by csnook
Adding elements of vectors
 
Is it possible to add elements of different vectors together? In my case each object contains, employee information but the last value contains the salary they ...
[1 reply] : Basically can I add getMonthsPay (for SalariedEmployee's) and getMonth... (by csnook)
using isDuplicate in a function
 
I think its silly, but curious how and where to put the bool isDuplicate Function that I have created in my void getChoices(). I'm so close to complete my entir...
[2 replies] Last: symbolic constant: MAX_USE_NUM =5 i simply have that one loop to dete... (by survivor31)
by Curdis
Trouble with bracketing search exercise.
 
Hey. I've been reading these forums for ages, trying over and over to find a solution to my problem and, despite many answers to questions surrounding this e...
[2 replies] Last: Thank you... SO MUCH! You are literally the best person ever for the ... (by Curdis)
Issue with inheritance
 
I made this little code to try understanding more the concept of inheritance and I came to a problem. At the line where I told Luis to attack Gerry (In Mai...
[12 replies] Last: void Wizard::fireball_cast (Character &target) { m_Total_dmg = m_d... (by jj09786)
Overloaded Functions
 
I am not sure how to make this overloaded function work correctly. The problem is this: Write two overloaded functions called max that takes either two or ...
[7 replies] Last: Between fixing my cin statement earlier and fixing my if/else if state... (by The117Vendetta)
If statements [Calculator project]
 
I was developing a very simple calculator on the console and it needs a lot of if statements but non of them seem to be working! The code is the whole program w...
[9 replies] Last: Please use code tags correctly. You need a tag after your code. ... (by AbstractionAnon)
using loops with structs
 
hello, I am calculating total pay for information stored in structs. total pay is calculated by an adding 10% of base pay for every five (5) hours over forty (4...
[8 replies] Last: Yes. What happens between lines 55 and 56? (by keskiverto)
Overloaded Operator Assignment
 
Hello all, I'm in a computer science class currently, and am in need of help in writing an overloaded operator for the following code. #include <iom...
[1 reply] : Create a new section and then add each of the three students to the ... (by AbstractionAnon)
Regarding Macro Usage
 
I am declaring a #define macro as: #define Control1(v, k) and I am calling the function as Control(abcd,efgh); where abcd, efgh are structures havi...
[7 replies] Last: @MikeyBoy and @TheIdeasMan: Thanks to both of you for your sense of h... (by koothkeeper)
fstream file read limiting
 
Hello, im designing a class where a user inputs are saved onto a file, then later retrieved to the program for other purposes, here is my relevant storing code:...
[3 replies] Last: Also you may want to consider using an ostream& instead of the fstream... (by jlb)
Having trouble with this project -- Counters, pool fill
 
Hey guys, I'm having trouble with a few parts of this project. In particular, I'm having trouble with the gallons per hour and the fill rate. I don't even know ...
[1 reply] : Write a function to prompt for the fill rate in inchesPerHour. If the... (by dhayden)
by ebucna
declaring object
 
I have a code with classes that compiles fine until I declare object for class Journey in line 25. When I add an object there I get: line 19: no matching fu...
[5 replies] Last: Well then the fix is explained above. (by Moschops)
Short Pointer Problem
 
As I know the initialize of the array ={11,12,13} are 11,12,13,0,0. There is no array[-3],array[-2],array[-1], therefore they should be -xxxxx.(some unknown) ...
[3 replies] Last: But the compiler show the answer is : array[-3],array[-2],array[-1],a... (by Chervil)
Reading text file segments
 
I have a text file which contains this exactly: int Bob, 2you, john, Adam.Smith; float taxYear=2013, taxRate=29.2.3; I need to analyze this text file whe...
[5 replies] Last: I'm having trouble understanding your getWord function Basically i... (by Chervil)
Read from file until a specific character is detected
 
Hello, simply question, how do i alter my cin fstream function so it stops reading until a specific character (in my case ',") is detected? Here is an exampl...
[1 reply] : For reading unit_ you need getline() again (like for sku2/name2).... (by coder777)
program passing structure arrays with functions
 
Hello, I am creating a program that that passes structure arrays through functions. I Am trying to get user input to add information to a strut variable using a...
[5 replies] Last: I want to organize lots of Payrolls for each worker. You want each w... (by MikeyBoy)
C++ Constructors help (Need quickly please)
 
delete post please
[3 replies] Last: The original post began "I've got this c++ homework assignment"; I exp... (by Moschops)
April 2016 Pages: 1... 40414243
  Archived months: [mar2016] [may2016]

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