We have a QCheckBox object, when user checks it or removes check we want to call a function so we connect our function to stateChanged ( int state ) signal. On the other hand, according to some condition we also change the state of QCheckBox object inside code, and this causes the unwanted signal.
Is there any way to prevent firing sig...
Hi there,
i´ve got a problem porting a C++ MFC Project from Visual Studio 2003 to VS 2008.
There is a problem creating Dialogs, that Ressources are in different Projects of the Solution.
The Project with the Main Frame starts a thread, that creates a little Splash Window. Another Project contains the code and the ressource to create th...
Can you do this?
char* func()
{
char * c = "String";
return c;
}
is "String" here a globally allocated data by compiler?
...
Hi,
I need to write a program that prints 100 stars on the screen (at random places), and then the stars disappear slowly - one after another. I'm not allowed to use loops nor recursions.
I've tried to play with the constructors and the destructors but I can't get the stars to disappear one after another (and not all together).
Any idea...
I have a file with records that looks like this
123 Tag Now is the time for all good men to come to the aid
There always a number and some tag followed by a series of words. I want to extract the number as integer, tag as string, and sentence as string. I've done this using getline and scan plus some substring foolishness.
Is there ...
How can I change the mouse cursor while dragging? I don't want the Blocking cursor or the Arrow with the Plus sign to be displayed, just the arrow cursor.
I'm using Qt 4.6.
Thanks
...
Hi All,
I want to use dll from ssdeep (http://ssdeep.sourceforge.net/). The API is:
int fuzzy_hash_buf(unsigned char *buf, uint32_t buf_len, char *result);
then in Delphi, i write it like this:
function fuzzy_hash_buf(buf : Pbyte; buf_len : Cardinal; result : PAnsiChar): integer; stdcall; external 'fuzzy.dll' name 'fuzzy_hash_buf';
...
Possible Duplicate:
Is there a performance difference between i++ and ++i in C++?
In terms of usage of the following, please rate in terms of execution time in C.
In some interviews i was asked which shall i use among these variations and why.
a++
++a
a=a+1
a+=1
...
Full disclosure - this is homework, although completed and fully working, I'm searching for a nicer solution.
I have a binary file, which was created by a program compiled within Visual Studio (I believe). The structure looks something like this.
struct Record {
char c;
double d;
time_t t;
};
The size of this structure o...
I'm working on a pretty standard Qt mobile app (written in C++, targeted at Symbian devices), and am finding that sometimes when the app is closed (i.e. via a call to QApplication::quit), the final destructor in the app can take a long time to return (30 seconds plus). By this I mean, all clean up operations in the destructor have comple...
I'm pretty new to C++, but I know you can't just use memory willy nilly like the std::string class seems to let you do. For instance:
std::string f = "asdf";
f += "fdsa";
How does the string class handle getting larger and smaller? I assume it allocates a default amount of memory and if it needs more, it news a larger block of memory ...
I am using Coverity on a C++ project. Is there some way of flagging false positives directly in the source code?
...
Hi,
I'm writing a recursive flood-fill algorithm to find connected components in an image, my code compiles and runs well with MSVC 2008 compiler; but the mingw-compiled binary crashed at runtime.
After I converted the algorithm to non-recursive with std::stack, everything goes well.
But what if I must use recursive algorithm in some...
I am aware of the 2s complement representation of signed values. But how does binary '10000000' become -128 in decimal(using %d).
for +64 binary rep = '01000000' for -64 binary rep = '11000000' which is 2's complement of '01000000'
can some one please explain?
Program:
int main()
{
char ch = 1;
int count = 0;
while(count !=...
Hi ,
i'm about to port very large scale application to 64 Bits,
i've noticed in that in the web there some articles which shows
many pitfalls of this porting ,
i wondered if there is any tool which can assist in porting to 64 bit , meaning
finding the places in code that needs to be changed.... maybe the gcc with warnnings enabled.....
Simple question; right now I have something like this:
typedef void(*MyFunctionPointer)(int);
typedef std::vector < MyFunctionPointer > MyFunctionPointerContainer;
However, I want to typedef this container in one row, skipping the first typedef, how can I do this?
...
I'm working on a library where I'm farming various tasks out to some third-party libraries that do some relatively sketchy or dangerous platform-specific work. (In specific, I'm writing a mathematical function parser that calls JIT-compilers, like LLVM or libjit, to build machine code.) In practice, these third-party libraries have a t...
The object is essentially BYTEs of dynamic length.
What's the easiest way to implement a send/receive mechanism?
I got a tip follows but have no idea how to roll this protocol myself:
Just remember that pipes, like
sockets, don't guarantee that
everything you put in the pipe will
come out the other end in the same
number of...
Suppose I have a function which takes some form of predicate:
void Foo( boost::function<bool(int,int,int)> predicate );
If I want to call it with a predicate that always returns true, I can define a helper function:
bool AlwaysTrue( int, int, int ) { return true; }
...
Foo( boost::bind( AlwaysTrue ) );
But is there anyway to call t...
A recieve a string like this:
<invoke name="CanClose" returntype="xml">
<arguments>
<string># 998.40</string>
<number>49920</number>
</arguments>
</invoke>
I'd like to use QDomDocument to get the values of arguments' child nodes by their index (I would like to extract the strings "# 998.40" and "49920" in the examp...