General C++ Programming - May 2013 (Page 18)

Pure Virtual Functions
 
From my book: "Because you have declared Volume() as const, its implementation in any derived class must also be const. Remember that const and non-const vari...
[12 replies] Last: [quote=Anmol444]What are you talking about, pointers to derived cannot... (by TheIdeasMan)
programming functions
 
Can someone please assist with how to use functions in a programme to show the names and grades of students, their average, total, highest and lowest grades. T...
[1 reply] : What have you done so far, and where are you having problems? If you ... (by Catfish4)
by mr5
MinGW: libpng won't build properly
 
So I need this libpng to be statically link with my dll to be used by my exe. This dll is already done before until I switch my compiler from MSVC to MinGW, t...
[1 reply] : You need to use CMake to build zlib and libpng with MinGW on windows, ... (by modoran)
Class in Class
 
How can this code compile? #include <iostream> using std::cout; using std::endl; class CBox // Class definition at global scope {...
[5 replies] Last: Oh ok thanks! (by Anmol444)
Asteroids problem?
 
So I was working on this project for class and I closed Visual studios and reopened later that day. Almost like a hour later... Then I got a problem when I hit ...
[3 replies] Last: It means you accessed a null or non existent pointer if you had the a... (by pogrady)
Infinite while loop vs for loop
 
Why is it that in a infinite while loop you must add a true but in a for loop you can leave it empty? Is it just how C++ works or any reason?
[2 replies] Last: Alright thanks! (by Anmol444)
Need help fixing a few errors in my program. (1,2)
 
The following program is a game i started creating. I need help fixing some of the errors i have created. #include <iostream> #include <string> #include <sstr...
[21 replies] Last: I'll just create a new post instead. I think before you fix your error... (by xismn)
Compiler outputting wrong size (1,2,3)
 
Main: // Ex9_01.cpp // Using a derived class #include <iostream> // For stream I/O #include "Box.h" #include "CandyBox.h" ...
[44 replies] Last: Alright I shall (by Anmol444)
CStack Class
 
In this code: // A push-down stack to store Box objects #pragma once class CBox; // Forward class declaration class CStack { private...
[3 replies] Last: Alright thanks! (by Anmol444)
What happens to memory if you terminate a program
 
Does the OS free all the memory?
[2 replies] Last: With (most?) modern operating systems, the answer is yes. On any O/S... (by andywestken)
by naz
error here plz find out i need help
 
int main() { //Create contituency and start flow Contituency* con = new Contituency(); con->start(); system("pause"); return 0; } ...
[3 replies] Last: I suggest you to change compiler. Looks like you current compiler doe... (by MiiNiPaa)
Nested Classes
 
From my book: "A nested class has free access to all the static members of the enclosing class. All the instance members can be accessed through an object of t...
[4 replies] Last: So you can always use it inside member functions? Just not as a member... (by Anmol444)
Having trouble printing out list using OOP
 
#include <iostream> using std::cout; using std::cin; using std::endl; using std::ios; #include "Course.h" #include <list> using std::list; #include <cs...
[9 replies] Last: Note that p is not a pointer, it's an iterator. How are iterators and... (by andywestken)
A pointer to base class
 
A pointer to base class, if assigned to a derived class, only points to the base part right? So you can only use the base part of the derived class with that po...
[8 replies] Last: I am sure you know much more about this than me I wouldn't say that.... (by naraku9333)
Extracting file name from path
 
Hello everyone, I have a string like this const char *filename = "C:/Qt/progetti/worlds/fasr.world"; then I have a string like this char *pathdir...
[6 replies] Last: Or you could use boost for a more portable solution. (The code is nea... (by cire)
Pointers to automatically null when object is deleted
 
Say I have an object and 10 pointers to it in several other objects of varying class types. if the object gets deleted, those pointers have to be set to null. n...
[1 reply] : Maybe http://en.cppreference.com/w/cpp/memory/weak_ptr (by naraku9333)
References to Base class
 
box.h // Box.h in Ex9_09 #pragma once #include <iostream> class CBox // Base class { public: // Function to show the volume...
[2 replies] Last: I know I figured it out xD (by Anmol444)
Including cocoa (objective C) in a C++ program
 
Hello, I am running OS X Lion 10.7.5 and trying to include cocoa. #include <iostream> #include <Cocoa/Cocoa.h> int main(int argc, char** argv) { std::co...
[4 replies] Last: Well, I've still gotten nowhere. Even when I use the exact code exampl... (by Blackavar)
by labeeb
Recording keystroke in C++
 
I want to record keystrokes as user press a key.Problem with cin is that it will not do this after hitting key I have to press enter this is what I don't want. ...
[1 reply] : If you want to create a game, read this: http://www.cplusplus.com/foru... (by MiiNiPaa)
I need help. The parentheses of an expression.
 
EDIT: No one's responding, maybe cus of lack of documentation? #include <vector> #include <string> //This function only works on cases: 2*(3*(4+(4*4) ) ), no...
[1 reply] : Just be clear, the problem isn't obtaining the parentheses. The proble... (by IndieExe)
May 2013 Pages: 1... 1617181920... 47
  Archived months: [apr2013] [jun2013]

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