c++

Some compiler errors concerning an overloaded operator on a template in c++

Hi all, I have some code with a few errorr I do not understand how to fix at all. I have asked my professor and TA, and consulted the internet with no luck, apart from understanding more precisely what the errors mean. From what I can tell, the compiler is either confusing my overloaded operator with built in operators, or it is not re...

Shifting to Java

I'm a C/C++ developer. I am just intrigued why some of my colleagues are shifting to java. They actually have a lot to say why Java is better than C++. This is actually more of a trivial question, but I know for sure it would be a source of enlightenment for many also for novices like me. Knowing only C++ and a little of java, how d...

Integrating wxwidgets in visual studio 2008

I want to make window-base application in c++, I have listen about wxwidgets. Can any one tell me how can I use wxwidgets library in my application, any link or tutorial which give me direction. ...

How to find out if this preprocessor macro exists?

Hi, I want to know how to find out if the preprocessor macro __PRETTY_FUNCTION__ can be used with a given compiler (As it is supposed to be non-standard). How do I check this in a header file? What I want to do is something like: #ifndef __PRETTY_FUNCTION__ #define __PRETTY_FUNCTION__ __func__ #endif But, I'm guessing what happ...

How to get the Win32_battery class information of the battery connected to computer through RS 232 Interface?

I need to get the battery information (Win32_battery class) (using WMI) of the battery connected to the PC through RS 232 Interface(C#.NET app). Can any one help me to get this information? ...

how to write a simple regular expression pattern matching function in c/c++?

This is a question in my paper test today, the function signature is int is_match(char* pattern,char* string) The pattern is limited to only ASCII chars and the quantification * and ?, so it is relatively simple. is_match should return 1 if matched, otherwise 0. so, how to do, i am really dizzy on this? thanks in advance! ...

#if inside the function

anybody can explain me epsilon what is this term although i did not use in my header file. like Right (const lPoint& a, const lPoint& b, const lPoint& c, double epsilon) { #if _NOT_USED_EPSILON return (( (a.x_ * b.y_) - (a.y_ * b.x_) + (a.y_ * c.x_) - (a.x_ * c.y_) + (b.x_ * c.y_) - (c.x_ * b.y_) ) < 0)...

What is this error? (And why doesn't it occur in other classes?)

Hi there, I'm trying to write a some container classes for implementing primary data structures in C++. The header file is here: #ifndef LINKEDLIST1_H_ #define LINKEDLIST1_H_ #include <iostream> using namespace std; template<class T> class LinkedList1; template<class T> class Node; template<class T> class Node { friend class Lin...

c++ What process is listening on a certain port in windows

I have created a program in visual c++, where i have implemented a web service. The web service is set to listen on port 80, but if another program already is using this port, the web service fail to start up. So when the webservice can't start, I would like to have a function or method, which can get the name of the process, that curr...

Using C++ and scripting together

I am developing simple games as a hobby. For my new project, I want some parts to be scriptable. I am familiar with python but don't mind learning new languages. Here is the question: I am planning to implement path-finding, field-of-vision, collision detection etc. in C++ but want to use scripts for AI state machines, scripted events. ...

how does dynamic_cast work internally?

Possible Duplicate: How is dynamic_cast typically implemented? Hi! how does dynamic_cast actually work? where does the runtime know from whether some piece of memory actually fits the datatype or not? Thanks! ...

How to dllimport in C++

I have a DLL and I would like to use some of its functions. #include <iostream> using namespace std; extern "C" __declspec(dllimport) int Initialize(char* localPort, char* adminServerName, int rpcTimeout); int main() { int res = Initialize("7864", "6000@kabc", 10000); return 0; } I don't have the DLL's .lib file, so is th...

Qt QScriptEngine and default conversions from Qt Script to C++

I'm trying to convert a QVariantMap to Qt Script object. If I understood correctly it should go something like this: QScriptEngine* engine = new QScriptEngine(); QVariantMap* test = new QVariantMap(); test.insert("testkey", QString("testvalue")); QScriptValue testqs = engine->toScriptValue(test); QString value = testqs.property("testkey...

Design (UML), Code a complete C++ program.

Possible Duplicate: Can you recommend good UML tutorials ? Hi there, I'm quite new to UML and C++, are there any tutorials that I can use as references when creating a complete C++ program, including the design (UML), class organizations (specially controller classes), file handling, etc. Thanks ...

C++ console game input && refresh function

Hello, I am writing a small console adventure game and I faced a few problems. 1. The input is kinda laggy, I'm using while loop ( while(getch() == 'w') ). After a key is pressed the first time, nothing happens (you have to press it 2 times) and if you switch directions (press key A/D/S) it also doesn't react the 1st time. If you hold a ...

is there any good site for reference on how to translate C++ to Delphi?

i am confuse on how to translate this code: to delphi? char **szWords; // recognized words char ***szPhones; // recognized phones per word float *pScorePron; // pronunciation score float **pScorePronPhone; // pronunciation score of ...

How is std::tuple implemented?

I'd like to know how are tuple implemented in standard library for C++0x. I tried to read description in libstdc++ manual and then read template listing, but it's really hard to understand how it works, especially when reading code. Can someone explain me in few sentences the idea of tuple implementation? I want to know this, because I ...

GDIplus Scale Bitmap

Hello i'm trying to change scale GDIplus::Bitmap and save in memory scaled BItmap, and i have problem. I try many different sample, and my result is NULL. For Example I try change resolution for image, using SetResolution, also i try convert bitmap from image->graphic and use one of constructors GDIplus::Bitmap scale, but i haven't resu...

How does the OS language represented in Linux

My Application is running in Linux. it would be localized. how can I get the OS Language? is it represented in Linux? as a numeric values? ...

c++ fstream concurrent access

What will happen if files are accessed concurrently from different processes/threads? I understand there is no standard way of locking a file, only os specific functions. In my case files will be read often and written seldom. Now if A open a file for reading (ifstream) and starts reading chunks. And B opens the same file for writing (o...