Hi all .. This question is related to the QLiskPickSelector class in Qt .. I want to show an instance of it but the problem is that the onle way to show it is to link it with a QMaemo5ValueButton and then have the user press that button .. Is there any other way to show this instance of QLiskPickSelector without using a QMaemo5ValueButto...
I am trying to do edge contraction on a graph.
n is the number of vertices in the graph.
The vector f containing pairs of vertices representing an edge contains the edges which are to be contracted.
The graph does not contain any self loops.
Please point out any logical mistakes if any in the code.
If the method is entirely wrong then...
I have a struct:
struct something {
int a, b, c, d;
};
Is there some easy way to set all those a,b,c,d into some value without needing to type them separately:
something var = {-1,-1,-1,-1};
Theres still too much repetition (lets imagine the struct has 30 members...)
I've heard of "constructs" or something, but i want to set t...
Dear reader,
I'm new to VBO's and read some articles on creating and using VBO's. I am working on a application where I want to create a dozen of rotating cubes. I'm connected to a server which pushes text messages to my application. When I receive 6 text messages, I render these messages using Pango and Cairo. Then I want to create t...
I declare the following two function pointers in my class:
void (*ptrFunc)(void *);
bool (*ptrValid)(char *);
Now for some reason, the second pointer (ptrValid) causes the program to crash on exit. When I comment out the declaration the program exits fine, but when I un-comment it, it crashes.
Nothing is being assigned to it, it isn...
I'm got a function in C++ that wraps an output stream constructor so it can pass in a pointer to a parent class that it's running in, ala:
pf_istream PF_Plugin::pf_open_in() {
return pf_istream(this);
}
When I do it that way, however, I get something like this:
pf_plugin.cc:103: error: no matching
function for call to
...
This is an interview question that I had:
int var = 1;
void main()
{
int i = i;
}
What is the value of i after assignment? It is really compiler dependent or is it just undefined? My g++ on cygwin seems to give me 0 all the time.
Thanks
...
I have been trying to create a 2D array of vector for a game. Here is an example of what I am doing.
struct TILE {
int a;
char b;
bool c;
};
TILE temp_tile;
std::vector<TILE> temp_vec_tile;
std::vector<std::vector<TILE>> tile;
for (int x = 0; x < 10; x++) {
for (int y = 0; y < 10; y++) {
temp_tile.a = x;
tem...
Can inner class access a private member variable of its enclosing class? There seems to be some contradictions on the internet and compiler. Compile (g++ on cygwin) allows it. But, some technical documents say that it is not allowed.
...
So I've got an output stream class that owns a pointer to a class that actually does the writing, and I need a copy constructor so that I can return initialized instances from a function so that I can bind certain values transparently to the user. To have reasonable copy semantics I'd really like to clear the writer pointer in the copie...
I'm trying to implement the irc protocol in a very basic manner. My first attempt is to use boost::asio and connect to a server and read the motd. AFAIK the motd is sent to every client when they connect. I have made the following test program and it seems to not do anything. It's not a very good piece of code but this is all I have afte...
I'm trying to build a container of string representations of ordinal numbers, searchable both by the string and by the number. For example, I can do it trivially, but inefficiently, with an array:
std::string ordinalStrings = {"zeroth", "first", "second",..}
getting the string with ordinalStrings[number], and the integer with a while(...
I have a class here that is defined like this:
struct USERFPOINT
{
POINTFLOAT UserPoint;
POINTFLOAT LeftHandle;
POINTFLOAT RightHandle;
bool isBezier;
};
struct SHAPEOUTLINE {
GLuint OutlineVBO;
int OutlineSize;
int OutlineWidth;
ARGBCOLORF OutlineColor;
};
struct SHAPECONTOUR{
std::vector<USERFPOI...
I have a dynamically loaded & unloaded DLL which requires COMCTL32.dll >= v6.0 and MSVCR >= v9.0. To ensure that the correct versions are loaded, I enable manifest file generation in Visual Studio project setting, and add this entry to another manifest file:
<dependency>
<dependentAssembly>
<assemblyIdentity
type...
hi.
Somewhere I have read that modern Intel processors have low-level hardware for implementing exceptions and most compilers take advantage of it, to the effect that exceptions become faster than returning results state using variables.
Is it true? are exceptions faster than variables as far as returning state/responding to state? re...
how do i create and save a data file in a folder of my choice in C++ program?
...
I am creating a windows:forms application. I have read some of the answers give to try to understand the concept of .h(header file) & .cpp(implementation files). As I created the GUI for my app. I noticed the code being placed in the .h file. But when I double clicked a button control to add code to the procedure, the code was created in...
Hi i am wondreing if there is some kind of c++ library that deals with http, http chunking etc. Google did not find anything :D
...
I have a listview in small icon mode on a modeless Win32 dialog with LVS_EDITLABELS set. Regardless of whether editing was begun by a mouse click or programmatically by calling ListView_LabelEdit() and regardless of whether ESC or RETURN was hit upon finishing editing, when LVN_ENDLABELEDIT notification is received pszText of NMLVDISPINF...
Hi,
This have been asked in the interview.
How to write own dynamic_cast. I think, on the basis of typeid's name function.
Now how to implement own typid? I have no clue on it.
...