c++

Why does update to a dll need recompilation and sometime not?

Why does update to a dll need recompilation and sometime not? ...

how to find the end of soap message recieved from server over ssl connection in c++

i am reading soap message from server over ssl connection using SSL_read(m_pssl,f_data,f_datalen) but it reading 265 bytes first. then i again called SSL_read() and it reads rest of message + starting of message. Can anyone tell me how to find the end of message over server over ssl connection? ...

General practice to specify a break after a default clause?

Possible Duplicate: break in a case with return.. and for default If I have a switch statement: switch() { case 1: ... case 2: ... ... default: break; } Is there any reason for the break in the default clause? I see this in quite a few places, but isn't it unnecessary? What is the general practice? ...

C++, what does this syntax mean?

i found this in this file: http://www.boost.org/doc/libs/1_43_0/boost/spirit/home/phoenix/core/actor.hpp What does this syntax means? struct actor ... { ... template <typename T0, typename T1> typename result<actor(T0&,T1&)>::type // this line I know what typename and templates are, my question is about actor(...

print something without semi colon

Possible Duplicate: Hello world in C with no semi-colons? how to print something in c/c++ without having semi colon in programme ...

C++ Filling an 1D array to represent a n-dimensional object based on a straight line segment

READ FIRST: I have rewritten this question with the help of a friend to be hopefully more specific in what is required. It can be found here I'm not very clear on n-cubes, but I believe they are what I am referring to as the square family. New Question Wording: Perhaps I wasn't clear enough. What I'm asking, is how to set a 1D array to...

Why is this C or C++ macro not expanded by the preprocessor?

Can someone points me the problem in the code when compiled with gcc 4.1.0. #define X 10 int main() { double a = 1e-X; return 0; } I am getting error:Exponent has no digits. When i replace X with 10, it works fine. Also i checked with g++ -E command to see the file with preprocessors applied, it has not replaced X with 10. I was ...

Explicit initialization of struct/class members

struct some_struct{ int a; }; some_struct n = {}; n.a will be 0 after this; I know this braces form of initialization is inherited from C and is supported for compatibility with C programs, but this only compiles with C++, not with the C compiler. I'm using Visual C++ 2005. In C this type of initialization struct some_struct n =...

What event (if any) does QTextEdit fire when the size of its content changes?

As the title says, how can I receive notification whenever a multi-line QTextEdit changes the size of its content? (Note: *content size* is different from the control size, i.e. I want to know when lines were added or removed, or changed height because of a font change). ...

How to get the volume GUID

Dear all, I am using win32 api with C++. I would like to know how I can get the volume GUID using a "device path". My device looks like this: \\?\usb#vid_04f2&pid_0111#5&39fe81e&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed} Thanks. ...

How to process signals in a Qt subclass?

How do I process a signal of in a subclass? Let's say my subclass is derived from QTextEdit and is interested in the signal textChanged. It seems silly to connect an object to itself, I should be able to simply override the textChange method -- but it isn't virtual. What is the accepted way to do this? ...

Any real use case for using the calling convention fastcall?

Hi, Have you had any real use case for using the calling convention fastcall? Thanks. ...

What is a good idea for a list of strings?

I simply want to build an RPG and make it as neat as possible, I wish to define a pile of strings which I may want to edit later, so I tried something like this: enum {MSG_INIT = "Welcome to ...", MSG_FOO = "bar"}; But I just get errors, such as that MSG_INIT is not an integer! Why must it not be a string, are that what enums are only...

C++ How to generate the set of cartesian product of n-dimensional tuples

I wish to generate some data that represents the co-ordinates of a cloud of points representing an n-cube of n dimensions. These points should be evenly distributed throughout the n-space and should be able to be generated with a user-defined spacing between them. This data will be stored in an array. ...

Division by zero: Undefined Behavior or Implementation Defined in C and/or C++ ?

Regarding division by zero, the standards say: C99 6.5.5p5 - The result of the / operator is the quotient from the division of the first operand by the second; the result of the % operator is the remainder. In both operations, if the value of the second operand is zero, the behavior is undefined. C++03 5.6.4 - The binary / opera...

Static variable definition order in c++

Hi i have a class tools which has static variable std::vector m_tools. Can i insert the values into the static variable from Global scope of other classes defined in other files. Example: tools.h File class Tools { public: static std::vector<std::vector> m_tools; void print() { for(int i=0 i< m_tools.size() ; i++) std::cout<<"To...

Why is gcov creating Code Coverage data for STL Headers?

When I run gcov foo.cpp it not only generates the code coverage report for foo.cpp, but for all the STL headers used by foo.cpp. Is there a way to prevent this? It seems to ignore standard library headers like <ctime>. Edit Just ran across this post on the gcc mailing list: Re: gcc, gcov and STL ...

fastest way to exchange data with SQL Server 2008

I have a native C++ windows client application and a SQLServer 2008 server instance. I need to transfer a whole bunch of data both ways. I'm currently using SOCI (http://soci.sourceforge.net/) with an ODBC backend, but have already identified several performance problems with it and would like to try alternatives. SQL data types used are...

Boost Serialization Library upgrade

Hello! How do I know that I can safely upgrade Boost Serialization Library on a production system without breaking compatibility with the existing data ? Is there any test that I should perform in order to be sure that all data stored in the binary format by previous version of the library will be successfully read by the new one ? Does...

How to read the whole istream correctly?

Here is a simple code to print all characters of a txt file on screen: #include <iostream> #include <fstream> #include <string> using namespace std; int main() { int **i; int j,k; char a; ifstream test("test.txt", ios::binary); while((a=test.get())!=-1)//if I use "while(!test.eof())" here, how to avoid the ...