c++

How does Microsoft handle the fact that UTF-16 is a variable length encoding in their C++ standard library implementation

Having a variable length encoding is indirectly forbidden in the standard. So I have several questions: How is the following part of the standard handled? 17.3.2.1.3.3 Wide-character sequences A wide-character sequence is an array object (8.3.4) A that can be declared as T A[N], where T is type wchar_t (3.9.1), optionally qual...

how to read html using c++ libraries in linux

is there any c++ libraries avialable to read ...

C++ project compiles as static library but not dynamic (Visual Studio)

I'm a little new to c++ in visual studio, and I'm trying to compile a massive C++ project with Visual Studio. I've gone through and added all source and header files to my project and also updated all of the include paths in the project properties. If I have the type of project set to "Static Library (.Lib)" the project will compile wi...

Is a std::list empty when it is first constructed - even if it is a member of a class?

I have defined a class that contains a std::list as a member. When I create an object of that class, I expected the std::list to be empty. However, I queried the iterators returned by begin() and end() and found that they were not equal. How can I ensure that my std::list member is empty on initial construction of the object? Here is ...

How to disable MFC writing workspace settings to registry?

By default, a basic MFC C++ project in Visual Studio 2010 will store all its workspace settings in the HKCU registry hive under a user-configurable key name. This includes last window size/position, ribbon settings, status bar, etc. How can you disable this feature completely so as to not write to the registry at all? I tried not sett...

Using/Mixing C in C++ code?

Is using C in C++ bad? Many people have told me that using C in C++ is bad because it's not as safe, and it requires more memory management. I keep telling them that as long as you know what your doing, and you delete your new's and free your malloc's then C isn't a problem. I'm currently on a forum where an argument over std::string v...

Create a function to check for key press in unix using ncurses

I have been looking for an equivalent to kbhit() and I have read several forums on this subject, and the majority seems to suggest using ncurses. How should I go about checking if a key is pressed in c++ using ncurses. The function getch() provided by ncurses reads character from the window. I would like to write a function that only c...

Differences Between Python and C++ Constructors

I've been learning more about Python recently, and as I was going through the excellent Dive into Python the author noted here that the __init__ method is not technically a constructor, even though it generally functions like one. I have two questions: What are the differences between how C++ constructs an object and how Python "cons...

method compile time assertion; still not working

I need a easy way to assert inside a template that a template parameter implements a method (or one of its parent classes). I've read Concept check library but is hard to find an easy example to do simple checks like this one. I've tried to follow other posts (like this one and this other one), which i've modified so i can make it gener...

C++ Function Conventions?

Just had a 'Fundamentals of Programming' lecture at uni and was told that the convention for using/declaring functions is to have the main() function at the top of the program, with functions/procedures below it and to use forward declarations to prevent compiler errors. However, I've always done it the other way - functions at top main...

Creating web service app for enterprise Java vs C++?

So we want to develop a service app (web Service with post/get API). What is language to go for secure, fast, enterprise app for about 2000 employers to use with about 20~40 services for interacting with DB server (which in my case will be Oracle) Dev time a year Dev team of 3. All capable of righting C++ code as well as Java (so they w...

C++ Difference between endl; and \n

Possible Duplicate: C++: std::endl vs \n Is there any difference between using an endl; or a \n in c++. If so why use one or the other? ...

How to incorporate this script into build process using VC++.

I'm using VC++ and want to write a script that can scan my source-code and at some places where it sees a text like "abc" then extract characters of that text and generate a selective piece of code like ones below at build time: first example of a piece of code : Func1(a); Func2(b); Func3(c); second example of a piece of code: {'a','...

c++ simple shared library in linux

Hello experts, Is the STD library a shared library or what is it ? out of curiosity . Are there any books describe in detail the shared , static libraries development ? Are there any tutorial ? p.s (i'm using netbeans , eclipse, anjuta) and the tutorials aren't useful as I'm trying to understand what's actually going on. ...

programatically switching "triple-monitors"

I have a VR920, and wish my app to automatically switch from dual-monitors desktop to third vga device (VR920) whilst retaining my previous primary monitor, these two then still being extended desktop. On Windows 7. EnumDisplayDevices()/etc only has access to the two active monitors (and virtuals?), so I cannot locate the VR920 device. ...

c++ how to write code the compiler can easily optimize for SIMD?

hello there! i'm working in Visual Studio 2008 and in the project settings I see the option for "activate Extended Instruction set" which I can set to None, SSE or SSE2 So the compiler will try to batch instructions together in order to make use of SIMD instructions? Are there any rules one can follow in how to optimize code such that...

Setting Up a Win32 DLL in Visual Studio 2008

Please bare with me. I am learning how to make these DLLs properly. Hopefully my questions become more intelligent as I go. I would like to make a Win32 DLL (unmanaged code) using Visual Studio 2008. After selecting New Project, in Project types -> Other Languages -> Visual C++ -> Win32 I selected Win32 Project as the project type. ...

What is the difference between '\n' or "\n" in C++?

I've seen the new line \n used 2 different ways in a few code examples I've been looking at. The first one being '\n' and the second being "\n". What is the difference and why would you use the '\n'? I understand the '\n' represents a char and "\n" represents a string but does this matter? ...

how to convert html to postscript using c++ programming

hey i need to convert html to post script using c++ on linux(note:no scripting languages) ...

Why can't I downcast pointer to members in template arguments?

If I make a pointer-to-base-member, I can convert it to a pointer-to-derived-member usually, but not when used within a template like Buzz below, where the first template argument influences the second one. Am I fighting compiler bugs or does the standard really mandate this not work? struct Foo { int x; }; struct Bar : public Foo ...