What happens if modulus is used in an 'if' statement??

I'm wondering what would happen if we used modulus in this way: if (input%2) more code here I know modulus re...

Compress string with GZip using qCompress??

I have a string of hex data (0a000a0165787a... etc) that I write to a file like this: void Output(QString FilePath,...

How to replace 'gluOrtho2d' in a Qt app?

I am working on bring back to life a program I wrote seven years ago. It is all written in Qt and uses some OpenGL ...

removing or ignoreing duplicate lines from txt file C++?

currently i am trying to read a text file and ignore the duplicate lines inside it. Here's the code sample of what i...

Bad allocation exceptions in C++?

In a school project of mine I was requested to create a program not using STL. In the program I use alot of Poin...

Appending to CMAKE_C_FLAGS?

I'm using CMake for a project that comes in two versions, one of which requires -lglapi and the other does not. So...

Conversion from 'myItem*' to non-scalar type 'myItem' requested?

I have this C++ code: #include <iostream> using namespace std; struct MyItem { int value; MyItem* nextIte...

base operand of ‘->’ has non-pointer type?

First, the code: // ... struct node_list { node_list *prev; node *target; // node is defined elsewher...

const vector implies const elements??

Does const vector<A> mean that its elements are constas well? In the code below, v[0].set (1234); in void g...

extra qualification error in C++?

I have a member function that is defined as follows: Value JSONDeserializer::ParseValue(TDR type, const json_string...

extra qualification error in C++?

I have a member function that is defined as follows: Value JSONDeserializer::ParseValue(TDR type, const json_string...

The #include<iostream> exists, but I get an error: identifier “cout” is undefined. Why??

I learn C++ and COM through the books. In the IDE MS Visual Studio 2012 I have created new empty C++ project, and a...

Difference between .dat and .txt in c++?

I am using .txt files in my program for reading and writing records (records contains both text and numerals). Recen...