c++

How to get user input from a prompt(terminated by press ENTER) in c++?

Anyone knows this tip? ...

The C++ Programming language, Definitions vs Declarations exercise (simple, if tedious help needed XD).

Hi there. I've been working through Bjarne Stroustrup's "The C++ Programming Language" (2nd edition - I know I should really get a new copy but this is a library book!), and had a few questions about one of his simpler questions. In Chapter 2, when talking about Declarations and Constants, he lists a set of declarations, some of which ar...

how to find classes present in a c++ library (.lib) ?

Hi, what tool can I use to find classes present in a C++ static library (.lib) ? This information is for building a library in one solution and use it in another solution by giving lib as input to linker. As the lib can come from 3rd parties, its difficult to find what services it is offering. ...

What is the cleanest way to extend this design for tree-rewriting?

I have a tree of objects, where each object has a std::vector of pointers to its children. The class of the object has a rewrite() method that is recursively applied to alter the object and its children, typically with the following transformations, where [N] is the object being rewritten and (M) is the element that rewrite() returns: ...

is it possible to compile code for WinCE platform through VisualStudio in WIndows ?

Hi, I need to compile code written in Visual studio 2008 in Windows XP for WinCE mobile platform. How to do it in Visual studio 2008 by changing target platform settings ? ...

What are the c++ compiler optimization techniques in Visual studio

Hi, I want to know compiler optimization strategies for generating optimized object code for my c++ app in Visual studio. Currently i am using default settings. ...

C for Java Programmer?

Possible Duplicate: Should I learn C before learning C++? As a professional (Java) programmer and heavy Linux user I feel it's my responsibility to learn some C (even though I may never use it professionally), just to make me a better coder. Two questions : Should I try C or C++ first - I realise they are different languag...

Nested STL vector using way too much memory

I have an STL vector My_Partition_Vector of Partition objects, defined as struct Partition // the event log data structure { int key; std::vector<std::vector<char> > partitions; float modularity; }; The actual nested structure of Partition.partitions varies from object to object but in the total number of chars stored in P...

Call a function in class members (C++)

Consider the following: These classes are in different header files and each header file has its corrresponding source files. //------------------------------------------ // in Z.h class Z { public: Z(); ~Z(); void DoSomethingNasty(); } //------------------------------------------ // in X.h class X { public: X();...

Looking for online contests

Hi!Since I'm getting ready for a competition , I'm looking for good online contests. I found codeforces and codechef and took part in them. but I need more practice so i decided to ask if you know good online contests. I have only 10 days to get ready so September contests won't work for me! Thanks ...

Using modal progress bar dialogs in Windows CE?

Hi, I'm writing a Windows CE application in C++ directly applying the WINAPI. In this application I parse a text file, which may or may not be large and thus may or may not take a while to load; and as I will add functionality to load files across the wireless network, I figured it would be best to add a progress bar. My aim is to disp...

c# web form Post file upload to from c++ program does not work for binary (zip) files.

I have a simple C# aspx script page hosted on IIs that uploads a file along with some email addresses and message etc. and sends an email with uploaded file as attachment. This all works fine from a browser, no problem, but that is not what I am trying to do :). I want to do this from within a c++ application so I wrote a class to mim...

C++ and Enumerable

I have a producer/consumers design in my application which implement Produce/Consume functions on user types. But it doesn't work very naturally with the standard library and especially with algorithms. In C# there is the Enumerable and Observable concepts that can be used to easily implement stuff like this and get alot of nice free fu...

Linkage of various const/static variables

I have a few questions about the linkage from the following variables. By examples of 7.1.1/7 of C++03 and experimenting with compilers (Comeau, Clang and GCC), I came to the following linkage kinds: First static, then extern static int a; // (a) extern int a; // (b) valid, 'a' still internal It's clear to me with accordance to sect...

Any existing DNS resolver project for windows? Both C++ or C# will do.

I've been trying to build a DNS resolver in C# since last week, which is a painful process. Though I've made some progress (say, I can parse the data of a DNS Message correctly), it became more and more likely to me that this may not be the right job for C#. I have to be prepared in case I had to port to C++. But it is best not do it...

C++ (or maybe Java/C#) books for understanding 'under the hood' ?

Hi, what are the best c++ books for learning the very advanced concepts? I know about OO programming, i dont need to know about classes but i'd like to know about how casting works, how the various memory data structures differ in their actual implementation (big O notation etc), deep and shallow copying, garbage collection etc? Any ver...

What is the difference between static and dynamic cast in c++?

Possible Duplicate: Regular cast vs. static_cast vs. dynamic_cast what is difference between static and dynamic cast in c++? ...

C++: Can't work with simple pointers?

I apologize as this is so simple, I was working with my own XOR swap method and wanted for the heck of it compare the speed difference between reference and pointer use (do not spoil it for me!) My XOR ptr function is as follows: void xorSwapPtr (int *x, int *y) { if (x != y && x && y) { *x ^= *y; *y ^= *x; ...

Template parameter constraints

Hi, I've been reading through this advice about template parameter constraints and was confused by this line: template<class T> class Container : Derived_from<T,Mybase> { // ... }; What's going on here? Is this just plain old inheritance being used to make the compiler examine Derived_from to perform the desired check? Why does ...

c++ check cursor position

im trying to see if the cursor is inside my game not on the menue or the border inside the game. i don't konw what function should i use? i thought of using GetcursorPos() but is there better function? ...