Beginners - November 2014 (Page 20)

What purpose does a class access specification have?
 
I have a program that has a "derived" class that inherits the public members of a "base" class. But I'm a little confused on what the class access specifier act...
[1 reply] : See http://www.tutorialspoint.com/cplusplus/cpp_inheritance.htm clas... (by keskiverto)
Vector subscript out of range error
 
Why am i getting this error message. for (int i = 0; i < a.size(); i++){ if (a == y) a.erase(a.begin()+i); cout << a << " "; } ...
[1 reply] : What if that is preceeded by: int y { 42 }; vector<int> a { y }; ---... (by keskiverto)
Create a file containing the following car numbers, number of miles driven, and number of gallons of gas used by each car
 
I am having a trouble with this question when it comes to loop a) Create a file containing the following car numbers, number of miles driven, and number of g...
[5 replies] Last: For average miles per gallon you just divide miles/gallon. For the tot... (by danghotties)
by HG319
tic tac toe game, check is board is full and is position is taken
 
I have a beginner tic tac toe program to write. For this assignment we do not need to know who the winner is, the game just has to end when the board is filled....
[3 replies] Last: Can you repost your code? (by PCrumley48)
Delete more than one record from .txt file
 
So i get the concept of how to do this but i'm just not doing it right. I have to ask the user if they want to delete any records. The user can enter -1 to fin...
[2 replies] Last: Ahh, i see. But i cant put it == to Student(id, firstName, lastName,... (by ezmesori)
getline function
 
I'm having issues using the getline function to read words from an input file into a string. I will then use member functions on these words later in the progra...
[2 replies] Last: Thank you, I tried to establish a string array like this, and I'm gett... (by JoJodoggy1)
finding least and greatest number
 
Okay so I haven't started writing the code yet but can I please have a hint on how to write a program finding least and greatest, its a for loop right ?
[2 replies] Last: An indirect hint: http://www.cplusplus.com/reference/algorithm/minmax_... (by keskiverto)
Calculating incorrectly- HELP please
 
MY program is running incorrectly, it will not calculate the correct salary with a 10% raise, can someone help please. // File: Lab 22P2.cpp // Created by...
[6 replies] Last: got it, thanks! (by melgunn6)
Pointers with Images Help
 
I get a memory access violation when I run the below code. void createNewImage(int width, int height); this function deletes any current image data and creates ...
[8 replies] Last: You should be using standard containers for that. My guess is you p... (by kbw)
Can someone please help me write this program
 
Suppose a large group of students are taking activity buses for a field trip. Each bus can sit 24 people. They want a program to tell them how many buses they...
[3 replies] Last: http://www.cplusplus.com/reference/cmath/ceil/ (by keskiverto)
Sum of Digits in a String
 
The instructions: Write a program that asks the user to enter a series of single digit numbers with nothing separating them. Read the input as a C-string or a ...
[2 replies] Last: As tcs mentioned it's a char. To convert simply subtract '0' (by giblit)
Multiple inheritance. Ambiguous access errors
 
Hello, I have to implement multiple inheritance. But i met these errors: ambiguous access of 'a' and ambiguous access of 'b'. Where is my mistake? Thanks! ...
[2 replies] Last: And favour #include <iostream> over #include "iostream" ... (by JLBorges)
hangman game help !
 
guys i have made a hangman game and its working well! the problem is that when i repeat a letter that is already guessed, it will decrement my guesses left. ...
[no replies]
Can i use = between class instances?
 
I need to change a class instance to another instance of the same class. I'm also using SDL; Here's my code (Or most of it): Item.h: #ifndef ITEM_H_I...
[1 reply] : You can do so! See http://www.cplusplus.com/articles/y8hv0pDG/ for how... (by tcs)
Need help with return functions
 
Hey guys. I have a programming class that I take once a week at my college. I had to miss last weeks class because of work, so I missed a ton of information. Af...
[16 replies] Last: thank you! You're great! (by melgunn6)
Help with a function please!
 
Ok my professor wanted me to wrtie a function that would simulate a coin being tossed and to display what the result of each flip was. I've done that part corre...
[3 replies] Last: The point of a function taking parameters is that the parameters affec... (by LB)
the If loop is not recognizing my variable?
 
Im not even sure how to say this, this is a very simple 'quiz' that i have as assignment, Read the questions from a file, read the answers from a file,and compa...
[2 replies] Last: Yes sir, the text given to me requested that I have to allow correctio... (by Dexterr)
need C++ code for a simple program.
 
program should display your own ID and name on the top of the screen through passing as attributes at the time of instantiating object of the Student class i.e....
[2 replies] Last: can u make code for me. im just a beginner at c++. welcome. cpp file s... (by victor6)
Help with loops, total noob here.
 
Hey guys im a programming noob and i would need some help with a litle loop. can you rewrite it in for and while loops. (it was a on a test and its only supp...
[7 replies] Last: Yes, it way better your way. so for for loop i did for(zn;(zn>='A... (by programiNOOB)
c++ 11 vs 98
 
so recently i used a for loop,that a person from this forum showed me for(char c:str) this gave me the compile error ranged loops not allowed in c++ 9...
[6 replies] Last: The GNU people think that you should have to specifically initiate C... (by Duthomhas)
November 2014 Pages: 1... 1819202122... 65
  Archived months: [oct2014] [dec2014]

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