c++

An efficient way to compute mathematical constant e

Hello, The standard representation of constant e as the sum of the infinite series is very inefficient for computation, because of many division operations. So are there any alternative ways to compute the constant efficiently? Thanks! EDIT After following some of your links, I believe that efficiency comes from a technique called bi...

How to get windows search history?

Hi is there any way to get windows search history in some form? I mean programatically in some kind of structure. Thx for answer. ...

How to get input from web?

Hi, i am trying to find out, how to get input from html inputs using c++. In windows you can send WM_GETTEXT to the window and it returns text, that you wanted. But is there any way to do the same thing in web interface?. I am not interesting in sniffing packets now. For example. Some site has html intput which expects name. I write na...

OAuth authentication for Google API with Qt

Hello guys, I'm trying to get authenticated for receiving and publishing Google Buzz-es from a Qt 4.6(c++) application. I'm looking for a cross-platform solution. Could anyone provide some working solution for this purpose? ...

c++ i need help with this program. everytime i try to run it, i got a problem

the program must read numeric data from a file. only one line per number half way between those numbers is a negative number. the program must sum those who are above the negative number in a acumulator an those below the negative number in another acumulator. the black screen shall print both results and determined who is grater or equ...

Move from *this in an rvalue method?

In C++0x, methods can be overloaded on whether or not the expression that denotes the object on which the method is called is an lvalue or an rvalue. If I return *this from a method called via an rvalue, do I need to explicitly move from *this or not? Foo Foo::method() && { return std::move(*this); // Is this move required or not?...

Qt Creator, is it possible to have radio buttons in menu bars?

Hi, I am making a GUI with Qt Creator, Qt 4.6.1 for my c++ application and I cannot find a solution to get radio buttons (or radio button behavior of the menu entries) in my menu bar. I am a newbie to Qt Creator, I hope there is an easy solution for this :-) Greetings ...

Compilation error while compiling an existing code base

Hi, While building an existing code base on Mac OS using its native build setup I am getting some basic strange error while compilation phase. Does any of you have any idea, as I have seen it's been discussed earlier as well in this forum without any good reason. I can not see any conflicting files being included. But still I am unable...

How Can I Blink Scroll Lock,Num Lock LEDs Using Programming Language....

Hello There Its Me vijay... Is There Any Method To Blink The LEDs Of Scroll Lock etc???... Post me the Code Snippet in any Lang....But My Preference Is c/c++,Java... PS:I M Making a Morse Code Program Which Blinks The Scroll Lock LED.... ...

Non-blocking TCP buffer issues.

Hi! I think I'm in a problem. I have two TCP apps connected to each other which use winsock I/O completion ports to send/receive data (non-blocking sockets). Everything works just fine until there's a data transfer burst. The sender starts sending incorrect/malformed data. I allocate the buffers I'm sending on the stack, and if I unde...

Connecting C++ to C#

I've been writing a program in C++ and noticed there is a library in C# that someone else wrote that I would like to link in to my code.... but I'm not sure how to do that. Can someone suggest something? Doubt this matters, but I'm using Windows 7 with MSVC2010. Thanks in advance! ...

How to encode series of images into VP8 using WebM VP8 Encoder API? (C/C++)

How to encode RBG images into on VP8 frames (Keyframe + some dependent frames)? So I created some images how to turn tham into VP8 now? ...

Strange profiler behavior: same functions, different performances

I was learning to use gprof and then i got weird results for this code: int one(int a, int b) { int i, r = 0; for (i = 0; i < 1000; i++) { r += b / (a + 1); } return r; } int two(int a, int b) { int i, r = 0; for (i = 0; i < 1000; i++) { r += b / (a + 1); } return r; } int main()...

safe dereferencing and deletion

Hi, I'm relatively new to C++ and OOP in general and currently trying to make such a class that allows to dereference and delete a dead or invalid pointer without any care of having undefined behavior or program fault in result, and I want to ask you is it a good idea and is there something similar which is already implemented by someone...

A generic C++ library that provides QtConcurrent functionality?

QtConcurrent is awesome. I'll let the Qt docs speak for themselves: QtConcurrent includes functional programming style APIs for parallel list processing, including a MapReduce and FilterReduce implementation for shared-memory (non-distributed) systems, and classes for managing asynchronous computations in GUI applications. For ins...

C++: Unsigned negative primitives?

In C++ we can make primitives unsigned. But they are always positive. Is there also a way to make unsigned negative variables? I know the word unsigned means "without sign", so also not a minus (-) sign. But I think C++ must provide it. ...

What does ': number' after a struct field mean?

Possible Duplicate: What does unsigned temp:3 means I came across some code like this that I am not sure with: unsigned long byte_count : 32 unsigned long byte_count2 : 28 What does the : mean here? ...

dynamic vector-like container but whose elements save their indexes?

All the elements should have fixed position in the array after insertion until I explicitly delete them from there. Is there something like this in boost or wherever? Thanks ...

C++ game loop example

Can someone write up a source for a program that just has a "game loop", which just keeps looping until you press Esc, and the program shows a basic image. Heres the source I have right now but I have to use SDL_Delay(2000); to keep the program alive for 2 seconds, during which the program is frozen. #include "SDL.h" int main(int argc,...

How to use dirent.h correctly.

Hello, I am new to C++ and I am experimenting with the dirent.h header to manipulate directory entries. The following little app compiles but pukes after you supple a directory name. Can someone give me a hint? The int quit is there to provide a while loop. I removed the loop in an attempt to isolate my problem. thanks! #include <iost...