c++

Is there a way to debug with the visual studio command prompt?

I've got a project that I need to get working with 3 compilers (borland, gnu, and microsoft). It works on 2/3 and now I just need to get it working with microsofts. It seems to crash in places that it works fine with the other compilers, so I'm wondering if there is a way to debug with the command line, maybe to get a stack trace or ge...

Error - "throws different exceptions" in C++

I am getting an error that tells me error: declaration of 'virtual FXHost::~FXHost()' throws different exceptions error: than previous declaration 'virtual FXHost::~FXHost() throw ()' I am not sure how to begin solving this, I have never encountered this before. in my .h I have: public: virtual ~FXHost()...

What is the lowest possible process ID that a Linux process can have?

On my system the lowest ID running right now is 1 (init). I'm making a small wrapper function around pidof and I was wondering, what is the lowest possible process ID a process can have? The reason I ask is because I would like to return an integer from my function indicating "process was not running" (pidof itself returns an empty stri...

what C++ casting operator is equivalent to (MyStructType){1,2,3} ?

Is there an C++ casting operator (or combination thereof) equivalent to the old-style cast below: struct MyStruct { int i; int j; int k; }; void do_something_with_mystruct( MyStruct ms ) { ... }; int main( int argc, char** argv ) { do_something_with_mystruct( (MyStruct){1,2,3} ); }; ...

C++ pointer to array of pointers to function pointers? any clue how to do it?

Maybe is a silly questiion, but I haven't found a solution to what I want. Basically, I would like to declare a pointer to an array of pointers to function pointers to functions with N parameters that returns an const pointer to an int. The code below is declaring an array of pointers to the function pointers: int *const (**fptr[10])...

Program to create a hash table

I want to read an array of integers, hash each integer and put it into an hash table and later lookup the table to search for the value. What would be the efficient way to do that in c/c++? Thanks in advance ...

OpenGL Multisampling Lines

Is there a way to just use multisampling on just lines drawn with OpenGL and not with the entire program? Thanks in advance! ...

how to support both common connection and SSL connection in gsoap

hi, i am facing a confusing question,i want to support both common connection and SSL connection in gsoap,but in this case, for common connection, it does not work after soap_ssl_accept() failed. how do i deal with this question. please help me. Thanks. ...

c++ return array in a function

Hi before someone storm "it's simple or duplicate" i swear i've searched but because it's pretty easy i couldn't find it between much more complex ones , unlucky maybe. Anyway my question is very simple , I have normal array int arr[5] that is passed to function fillarr(int arr[]) all i want is fixing the next code: int fillarr(int arr[...

How can i attach userdata to each item in a listview? C++ Win32

I was thinking i could use the LVITEM structures LPARAM to attach a pointer to my class, but i can't seem to get it to work! Heres the main parts of my code: Creating the listview: hlvQuiz = CreateChild(WC_LISTVIEW, "", WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | LVS_ICON | LVS_AUTOARRANGE, 0, 0, 320, 240, m_hwnd, FontN...

Does the GPC polygon clipper do triangulation?

I was looking at this question Here in regards to this library. However it is still unclear to me if this library can do like glu tesselator does and return a series of triangles which I can then render with OpenGL. If it can do this, how is this done? I'm just not clear on this from reading the docs. So essentially what i'm trying to fi...

What's the meaning of this C++ struct?

Hi, I got a simple C++ struct as follows: // Functor for peak to decreasing intensity sorting struct cmp_decr_int2 { bool operator() (peak2 a, peak2 b) { return a.int2 > b.int2; } }; is there an overload of the operator in this sample? ...

Crossplatform alternative to Winsock?

I basically am looking for a cross platform way to do basic things such as accept connections and send and receive data. What library would work in Linux, Windows and Mac? Thanks ...

Where is dynamic memory allocated?

The question was asked to me in an interview and my answer was "computer memory". But where exactly..? is it the Random Access Memory or the hard drive? ...

The best database for a C++ and java applications

Hi I am making an ATM console application in C++. I am planning to use a database, my friend suggested to use files. However, I want to use a database like mySql, Oracle or sqlServer express. Q: Which one of the databases would be more applicable for a C++ application ? I am also making a second application in java. This is a large li...

How Can This Recursive Function Work?

I can't figure out how this works, to my mind, once it gets to the answer it doesn't do anything with it. Node* FindNode(Node *rootNode, int data) { if (!rootNode) return NULL; else { if (rootNode->data == data) return rootNode; else { FindNode(rootNode->left, data); FindNode(rootNode->right, data); } ...

Can some help me to convert c++ code to Objective c

What would be equivalent objective c for this: template<class T> class Singleton { public: static T * instance() { static T t; return &t; } private: Singleton(); ~Singleton(); }; While calling: friend class Singletone<MyManagerClass>; ...

const type qualifier soon after the function name

Might be a basic question.Still i am eager to know it from this forum as i like the explanations given here. In C++ some times i see members like below: return_type Function_name( datatype parameter1, datatype parameter2 ) const { /*................*/} what does this const type qualifier exact do over here. ...

c++ mouseover event

ok s it is really easy to create mouse over event if the object is NOT moving. but the problem that the object gonna be moving every 50 millisecond. it is not a string line so i can create a script it is a circle. i used to use getcursorpos(). than get the object x and y. the other problem is this p X--------------------- y | | ...

Any good C++0x overviews?

I teach C and C++ and I was just wondering if there are good overview of the C++0x features. I am going to read the standard, but that will take time and I'm definitely going to make it for this semester (next year hopefully). For this semester I just want to make one extra lecture about C++0x (and maybe make sure that none of the taugh...