Beginners - October 2010 (Page 29)

problem with class and inheritance program.
 
Hi, my name is Matt Barker and I am c++ beginner. So far I have been learning C++ programming for about a month. I am kind of confused with how classes and inhe...
[1 reply] : What do you mean implement the constructors? You mean implementing the... (by Analyzer)
How can produce division
 
This is part of what I'm working... void functiondivide(){ int size = 50; float iarray ; for (int i=0; i<size; i++){ iarray =...
[15 replies] Last: void functiondivide(){ long int num1, num2, total; int re... (by Analyzer)
by wasabi
Reference vs. pointers
 
I've recently discovered how to use reference arguments in an actually useful manner, but was surprised when I realized a large difference in speed between it a...
[9 replies] Last: Well yeah, that's it. I removed the operator and everything went a mig... (by wasabi)
Static const
 
How would i implement a static const that displays my name?
[2 replies] Last: 1. static const, ok, but what variable type? char*? string? 2. Displa... (by LB)
by RichL
Int main() problem
 
I'm a true beginner to c++. I can't find an explanation for what int main(int nNumberofArgs, char* pszArgs ) does? My Dummies book from which it comes, neve...
[5 replies] Last: Thanks to you guys. You've helped me. (by RichL)
by Maerle
doubt
 
what's the difference between macro and functions? What's the advantage and disadvantage of each one? Show me an example showing the diference if possible.
[3 replies] Last: Yet more reasons to avoid macros: macros ignore language scope rule... (by Disch)
Very wierd error with cout - dumb mistake I think
 
Hi all, I'm working on using classes, and functions inside those classes. However right now I'm having a problem with my "cout" command. I'v cutted the m...
[3 replies] Last: What are you intending to do at line 14? because you can't put executa... (by Galik)
list::erase()
 
Hello again, is it possible to erase elements of a list whilst iterating through the list? , or it something you do at the end after identifying which elements ...
[4 replies] Last: Hello again, i've been reading about the erase() command and looking ... (by Mike200)
How do I access Public Data members in the main function
 
Hey Everyone, I've written this Gambling game in Object-oriented programming. There is a public data member Cash in the class gamble - i want to use it in the...
[4 replies] Last: Oh yeah, that makes sense! And it works too :) Thanks Everyone, ap... (by waqqassheikh)
by js92
check data type
 
I'm writing a program to calculate the ballistic range of a projectile but I need a way to check to make sure what the user inputs is a number intead of say, th...
[1 reply] : The you do cin >> [integer/float and so on]; if there is no number i... (by hamsterman)
Passing multi-dimensional arrays to functions
 
Apologies if this has been answered, but my scouring of the internet has not been able to solve my problems so far. Essentially, I want to pass a 2-D array to a...
[1 reply] : Read this: http://cplusplus.com/forum/articles/17108/ Especially this... (by R0mai)
Constructor
 
Can someone pls explain to me what this constructor actually means MinLeftistTree(LeftistNode *init=0) root(init){};
[4 replies] Last: Thanks that works :) (by draghava)
How can I access a member from another class?
 
Hey there, I can't seem to figure out why i can't access the member '*next' from the Node class in the Shuffle function. Any help would be great. Thanks. /*...
[1 reply] : I'm not willing to compile your code myself. Explain in greater detail... (by hamsterman)
UML
 
Can someone help me with this? i don't know how to draw a class inheritance diagram for this class: Class Dog is derived from Object and adds a member varia...
[3 replies] Last: This seems to be a typical homework. Try to google "url tutorial" or r... (by Monika Duerr)
Free C++ complier
 
Is there any good C++ compliers that I coudl downlaod for free off the Internet? I'm cirrently using DEV BLOODSHED and it's giving me alot of problems with givi...
[17 replies] Last: Dev C++!?! No wonder you want a change. And if you don't have a pro... (by clover leaf)
by tonnot
Declare private things at h or c
 
Hello, I've seen some c++ code examples with private: section at .h file. I dont understand the finality of it. If thery are private.... Can anyone give me ...
[14 replies] Last: kfmfe04 : I often prefer the latter construct over the former becaus... (by tonnot)
how to add arrays?
 
I have a homework assignment where I have to write a program that asks the user how many students to process, then reads in the scores for two items (an exam sc...
[5 replies] Last: That makes sense. My code works now! Thanks for all the help! (by Izzythemachine)
First Loop-Based Program: Undeclared Identifier?
 
#include <iostream> #include <iomanip> using namespace std; int main() { int number = 0; float cost = 0.0; char beverage; bool validBeverage; ...
[3 replies] Last: This might simplify the whole thing. #include <iostream> using ... (by AlphaBravo)
by airowe
Pure Virtual Functions and Abstraction
 
I'm having an issue creating a concrete class using polymorphism. I've declared a pure virtual area() function in two different classes and one pure virtual vo...
[9 replies] Last: Galik, thank you so much! That was it. Problem solved... (by airowe)
overloading the "-" operator
 
The implementation code for this overload will run, but it gives me an error when I actually try to use it in an application. // FILE: bag.cxx // CLASS I...
[2 replies] Last: Your - is overloaded incorrectly. - should not modify the left valu... (by Disch)
October 2010 Pages: 1... 2728293031... 42
  Archived months: [sep2010] [nov2010]

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