I need to call a virtual method for all classes derived from a given base base class right after the construction of the derived object. But doing so in the base class constructor will result in a pure virtual method call
Here is a simplified example:
struct Loader {
int get(int index) { return 0; }
};
struct Base{
Base() {
...
So basically i've never worked with CSV files before, but im making a program thats going to be calculating and outputting ALOT of data to files (8 separate files)
Basically it's going to do a formula. then output it as something like: (| means seperate column)
int | int | int | float | string | int | int | int | float | final_float
in...
Here is the problem: I monitor a directory using Win32 API ReadDirectoryChangesW function. And I need to distinguish between newly created files and modified files. But there are problems... as always :(
Cases:
I monitor directory for new/modify (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE). Problem: After file creation, ne...
I have python extensions implemented on c++ classes. I dont have a c++ target to run valgrind with. I want to use valgrind for memory check. Can I use valgrind with python?
...
Hi,
I'm wrapping C++ code into Python and .NET code by using SWIG 2.0.0.
I'm able to wrap a (myClass*, std::string) by introducing the following sentence in the "interface.i" file:
%template(Dictionary_myClass_String) std::map<myClass*, std::string>;
But I'm getting several errors if i try this:
%template(Dictionary_myClass_myClass)...
I'm starting a database application. The application should connect over http to a mysql database. The application should display the database records table-like. Some dialogs are necessary (reflects a database-record). I'm thinking of a dialog-based MFC application with some functions available via menu and which connects via SOAP to th...
Hello. My name is Guillermo and i'm studing Computer Sciences at college. For my final project, i have to build a game on Borland C++ and i was curious about making a GUI for it
The game is really simple. Create a matriz dimension 4x4 (with 16 elements) and fill it with random numbers from 1 to 15 and one empty space. The user/player wo...
I am trying to understand what this means, the code I am looking at has
in .h
typedef void (*MCB)();
static MCB m_process;
in .C
MCB Modes::m_process = NULL;
And sometimes when I do
m_process();
I get segmentations fault, it's probably because the memory was freed, how can I debug when it gets freed?
I hope my questions ar...
In OS's like WS2008R2 and its compliment 7, I need to hibernate one (of two) hard drives. The hard drive in question gets hot (cos its old) and is only used to write images of the main HD too once a week.
I would like to issue it a "sleep" or "hibernate" command.
Also, I dont want it to wake up when unless an app is needs to read/write...
Suppose I define a function in C++ as follows:
void foo(int &x) const {
x = x+10;
}
And suppose I call it as follows:
int x = 5;
foo(x);
Now typically (without the const keyword), this would successfully change the value of x from the caller's perspective since the variable is passed by reference. Does the const keyword change th...
hi everybody, i can't understand following defining pointer variable. can you help me?
double(*)(double *) foo;
note : sory, i edit name of variable func to foo.
...
Hi!
I would like to do something like this (I'm aware that this won't compile):
struct Container{
vector<int> storage;
};
float foo(Container* aContainer){
if(aContainer!=NULL)
vector<int>& workingStorage=aContainer->storage;
else
vector<int> workingStorage;
workingStorage.reserve(1000000);
....u...
Does anyone know of a way to call MIT's Meep simulation package from C# (probably Mono, god help me).
We're stuck with the #$@%#$^ CTL front-end, which is a productivity killer. Some other apps that we're integrating into our sim pipeline are in C# (.NET). I've seen a Python interface to Meep (light years ahead of CTL), but I'd like to...
I'm making an attempt to learn C++ over again, using Sams Teach Yourself C++ in 21 Days (6th ed.). I'm trying to work through it very thoroughly, making sure I understand each chapter (although I'm acquainted with C-syntax languages already).
Near the start of chapter 5 (Listing 5.2), a point is made about unsigned integer overflow. Bas...
Just more a general question I can't seem to find a definite answer on.
But what is a good SQL wrapper for C++ that allows me to call queries?
I'm used to Oracle, but i've used MYSQL before aswell.
And how would you call something such as an insert statement (for example) in one?
...
Hi,
I am programming in OpenGL and C++. I know 2 points on 1 line ( a diagonal line) and wish to rotate an object around that diagonal line. How can I go about doing this? I know how to use glrotatef to rotate it around the x, y or z axis but am not sure about this
Thanks
Jessica
...
I can't seem to get my code to create either a child class or parent class, depending on input. Here's the code:
BST<countint> t;
if (rst)
RST<countint> t;
t.print_type() // always prints "BST"
RST is a child class of BST.
print_type() is just a test method I wrote. RST only really inherits one method, repair(), which is virtual...
Hi,
I use a POCO lib for my project of email client.
I have a problem with parsing subject of email.
example:
I receive mail with subject like this
=?utf-8?Q?=D0=A2=D0=92=D1=82=D0=B5=D0=BA=D0=B0_=2D_=D1=80=D0=BE=D1=81=D1=81=D0=B8=D0=B9=D1=81=D0=BA=D0=B8=D0=B5_=D0=BA=D0=B0=D0=BD=D0=B0=D0=BB=D1=8B_=D0=BE=D0=BD=D0=BB=D0=B0=D0=B9=D0=B...
#include <string>
#include <tr1/regex>
#include "TextProcessing.h"
const std::string URL_PATTERN("((http://)[-a-zA-Z0-9@:%_\\+.~#?&//=]+)");
const std::string REPLACEMENT("<a href=\"$&\"\">$&</a>");
std::string textprocessing::processLinks(const std::string & text)
{
// essentially the same regex as in the previous example, b...
Lets say i have something like this coded
class Normal_Mode;
class Fast_Mode;
class File_Control; //handles all operations with reading/writing in file
class Main_Control {
private:
some_class *root; //all other classes need access to root pointer since there is all the data(binary tree)
File_Control *c_file_control;
Fast_Mode *c_fa...