I am planning is an OpenID client in a multiplayer network C++ game. The hoster will have the option to allow only logins from people who can authenticate via OpenID. Also I want to make it possible to allow only certain people to login.
We already have some simple HTML viewer in our code (and we plan to migrate to WebKit), so displayin...
Hi,
I am trying to read in two strings separated by a space.
cin>>a;
cin>>b;
This should technically work. I have also used getline but it doesnt seem to work.
It reads in some of the inputs and gets stuck on others
Edit: Added C++ tag, kept C tag since it's part of the original post.
...
#include <iostream>
class A {
public:
A(){ cerr << "A Constructor" << endl; }
~A(){ cerr << "A Destructor" << endl; }
A(const A &o){ cerr << "A Copy" << endl; }
A& operator=(const A &o){ cerr << "A Assignment" << endl; return *this; }
};
class B : public A {
public:
B() : A() { cerr << "B Constructor...
Hi,
something strange is happening to my code. I am using a library which is supposed to work perfectly (nglib from the open-source Netgen mesher). I can link and include everything, but I cannot use this library :
The object I want to use is Ng_Mesh* mesh = Ng_NewMesh ();
The Ng_NewMesh() method is :
DLL_HEADER Ng_Mesh * Ng_NewM...
I'm working on developing a fairly robust 2D game engine as a base that other games can be built off of as a for-fun project (I know theres already things that do this, but that's no fun).
I'm trying to figure out a good way to do message-passing between classes within the engine. At first I was thinking about using a heirarchy of exce...
I'm writing a lighter version of some containers from STL for myself.
(I know that STL was written by professional programmers and I am too stupid or too ambitious if think that I can write it better than they did. When I wrote my list (only with method I need), it worked few times faster. So, I thought it's a good idea. But, anyway.)
...
The following C++ code, compiles without warning in Visual Studio 2010:
extern void callFunc( int, int );
struct str_wrapper
{
str_wrapper();
};
extern bool tryParseInt( const str_wrapper
void test()
{
int x, y;
if ( tryParseInt( str_wrapper(), x )
}
}
However if str_wrapper has a user-defined destructor, the code generates t...
I want to do something like:
/*
* Superclass.h
*
*/
class Superclass
{
const int size;
public:
Superclass():size(1){}
~Superclass(){}
};
/*
* Subclass.h
*
*/
#include "Superclass.h"
class Subclass : public Superclass
{
public:
Subclass(){size;}
~Subclass(){}
};
...
Hello everyone,
This is my first question on stackoverflow.
I am trying to debug a program but when I try to run it, it terminates with error message
Debug Assertion failed and when I retry to debug it a break-point is created which takes me to
vector in this function
#if _HAS_ITERATOR_DEBUGGING
_Vector_const_iterator(_Tptr _Ptr, co...
I'd like to know how to archive a distributed (database) transaction between a java and a c++ application.
Are there some frameworks/jdbc extensions to do this?
What pitfalls may arise?
The solution may be oracle-specific, but a more general approach (at least on the java side) would be prefered, if equal.
...
Hi Folks,
I'm trying to User MySQL Connector/C++ with Qt, and had spent hours pulling my hairs on a problem. Here's a SIMPLE code to test out the connection:
int main(int argc, char *argv[]) {
QCoreApplication a(argc, argv);
cout << "aa" << endl;
sql::Driver *driver;
try {
driver = get_driver_instance();
} catch(exception &e) {
...
I'm trying to use the .NET class OpenFileDialog in C++ and getting a weird bug. My basic code is below.
OpenFileDialog^ openFileDialog = gcnew OpenFileDialog;
openFileDialog->InitialDirectory = "c:\\";
openFileDialog->Filter = "Bitmap|*.bmp|All Files|*.*";
openFileDialog->FilterIndex = 1;
openFileDialog->RestoreDirectory = true;
if (ope...
C/C++ would be good option to write some of the performance critical aspects of a Ruby Application. I know this is possible.
I would like to know how to add C/C++ code into Ruby code; any other language for that matter.
Are there any practical applications of this which you noticed in open source projects or else?
...
Hooooookay so here's another "I just have no idea what's going on" problem:
The first time I make a call to getFullWL() below, I get all my values as expected. Each subsequent call, however, returns nan instead of the true value(-nan(0x400000000) in XCode or something)
Furthermore, if I put my "debug" lines in SFLog the value prints a...
I am taking a course on computational geometry in the fall, where we will be implementing some algorithms in C or C++ and benchmarking them. Most of the students generate a few datasets and measure their programs with the time command, but I would like to be a bit more thorough.
I am thinking about writing a program to automatically gen...
If it even exists, what would a std::map extended initializer list look like?
I've tried some combinations of... well, everything I could think of with GCC 4.4, but found nothing that compiled.
...
Suppose you have a private static method called Inst() which allows the class to retrieve the single instance of itself in the application in its static methods. Maybe Inst() is defined something like..
return App::GetApp()->CurrentState()->MyClass(); // Inst returns a reference
Compare this...
// I prefer this
Inst().DoThis();
Inst(...
I have a novice question since I just started learning C++ not too long ago. I have the following if statements two of which don't seem to work. I don't get why it works when I try to compare it to a single character "y" or "n" but not when I try to compare it to two characters in one else if statement. The last question I have is if the...
Hello!
I have the following problem in application architecture and am willing to solve it (sorry for a lot of text).
I am building a game engine prototype and I have base abstract class AbstractRenderer (I will use C++ syntax, but still the problem is general).
Assume there are some derived implementations of this renderer, let's say...
Hi, I've got 3 files that relate to this problem. file.h, file.C and user.C.
file.h has a private member, fstream logs.
In file.C's constructor it opens logs. It doesn't do this in the constructor, but the constructor calls a function OpenLog().
file.h also has an inline close function:
CloseLog() {if (logs) logs.close();}
The f...