General C++ Programming - January 2014 (Page 10)

calling a virtual function of a base class that is assigned a derived class uses base class function
 
I've attempting to call the function fly(), it's a virtual function of the base class FlyingBehaviour and derived class FlyWithWings. when I do this Flyin...
[5 replies] Last: Yes, whoops, you're right I missed the ampersand. (by LB)
Size of deriverd class with overriding virtual functions from base class
 
Hi, The compiler creates virtual table for the base class and also for the derived class whether we override it or not. That means each class has separate v...
[1 reply] : B does not extend A in your code... (by LB)
Display integer
 
With the loop below, is there a way to display the actual number without the leading zeros (scientific notation) or will it just display 0 since there are so ma...
[6 replies] Last: Note that your computer will be unable to reliably distinguish betwee... (by long double main)
invalid conversion from 'char' to 'char*'
 
Dear guru, The simplified code below works correctly. But when I try to replace line 43 with out2 = sentence ; , it gives this compilation error: invali...
[7 replies] Last: Dear all above, I have create another thread, putting this question ... (by activecat)
by Droopy
Problems with iterators
 
So I have this problem with not being able to iterate over a vector in a nestled for-loop. Here's the nestled for-loop (Sorry for the lack of indentation): b...
[1 reply] : Try replacing spriteOne->collisionDestroy(sprites); spriteTwo->colli... (by naraku9333)
by Garion
Shared Library vs Static Library
 
I've been reading about libraries; How to make them, how to use them, the different types of libraries, etc.. I'm still haven't fully grasped how to implemen...
[8 replies] Last: Thanks, it works now :D I was a bit confused because when I compiled ... (by Garion)
C++ class HelP
 
How can i do this? Create a Friend class that contains a first name, last name, a birthday, and a telephone number. Create a Contacts class that contains an...
[3 replies] Last: 1) Your problem description says that Contacts shoud contain an array... (by MikeyBoy)
by KBeard
C++ program start up
 
I am new to C++ and I have exercise to make code as described below: Write a program that reads in the cost of an order (possibly a decimal like 48.99) and t...
[no replies]
varName.c_str() 2
 
varName.c_str() 2 definition of above syntax and any example please?
[1 reply] : http://www.cplusplus.com/reference/string/string/c_str/ (by Disch)
by matzke
Returning an std::ostream by value
 
Greetings. I'm writing a multi-threaded logging library and need to be able to return-by-value a new subclass of std::ostream from a factory-like function. I...
[3 replies] Last: I considered wrapping a pointer, but the drawback is that then the use... (by matzke)
help with open GL (C++ 2008)
 
I want to draw a car and house but I could not set the vertex of them even though I did draw square ,triangle and pyramid. So who can help me out in this
[2 replies] Last: Thank you Computergeek01 (by Mor cicek)
inaccessible constructor
 
Hi,everybody!I am trying to make an object in my main function from the class CCellDescr.But the compiler every time gives me the error that the explicit constr...
[4 replies] Last: Because, you have declared everything within you 'CData' class as 'Pri... (by ajh32)
Best online Computer Science program?
 
Hey all, Beginner programmer here, learning c++ to start off, and I really enjoy it and am reserching going to school for it. I've been resercnig best onli...
[no replies]
Display last 1000 lines
 
Hi, I am writing a piece of code that requires me to display the last 1000 lines from a multiple text files (log files). FYI, I am running on Linux and using g...
[6 replies] Last: Thanks for the input everyone. I ended up implementing the following. ... (by TacoLover)
changing a variable value according to it's name
 
hello, I was wondering if there is a way to change a certain variable's value if I know it's name? For example,say you have a struct called 'profile' who ...
[7 replies] Last: > Any advice? Well, switch to a more modern compiler; Visual C++ 12.0... (by JLBorges)
Outputting transactions from a text file to the screen
 
Hi I am working on a wage application with four options which are as follows: Subtracts an amount from the shop bank account (The account is text file "shop"...
[1 reply] : what you need is a an array for the recent transactions and a count. L... (by coder777)
Processes
 
Including the main, how many proceses does the following program create? Assume that there is no failure in process creation and proper header files have been...
[2 replies] Last: > Is the answer to this 9? Yes. > And if I changed n to 3 would it ... (by JLBorges)
by Kubani
Why namespace doesn't work in that code?
 
Hi all, I after vast effort could (details are in here http://stackoverflow.com/questions/21063872/fltk-version-1-3-2-visual-studio-2012-and-the-first-exampl...
[6 replies] Last: OK dear Peter. Your answers are very informative, thank you. But ab... (by Kubani)
by xkara
how to access certain elements in c++ and store multiple inputs
 
I am new to C++ and am trying to create a program that asks the user personal questions. std::vector<std::string> name, age, favsinger; std::cout ...
[4 replies] Last: #include <iostream> #include <string> #include <vector> int main() {... (by JLBorges)
freeGLUT keyboard input issue
 
I am struggling with keyboard input here, Would you guys please check my code and tell me what changes should i make? my keyboard inputs are not getting accep...
[no replies]
January 2014 Pages: 1... 89101112... 25
  Archived months: [dec2013] [feb2014]

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