c++

What's the best way to make a bitwise function work for any type of integer input c++?

So I need to read flags in bits and set flags in bits. These bits are in various sizes of integer: int16, int32, int64, etc. I would like to have a function that does something like this: static integertype function(integertype data, char startbit, char endbit); I don't want to code what will be the same code to isolate bits from for...

What's a portable and lightweight C/C++ regular expression library?

Possible Duplicate: Lightweight and portable regex library for C/C++? I'm looking for a C++ (C is acceptable, too) library for matching regular expressions. The library should satisfy these requirements: Can be built on Windows (MSVC 7 and newer) Can be built on Linux (g++ 3.4 and newer). Has no external dependencies; nothin...

Any tutorial for embedding Clang as script interpreter into C++ Code?

I have no experience with llvm or clang, yet. From what I read clang is said to be easily embeddable Wikipedia-Clang, however, I did not find any tutorials about how to achieve this. So is it possible to provide the user of a c++ application with scripting-powers by JIT compiling and executing user-defined code at runtime? Would it be po...

How to start 64-bit programming with visual studio 2010?

What do I need to do to start making 64bit programs in VS? I tried using 64bit solution platform setting and used "copy settings from x86" option. The process shows up as 64bit. Is there anything else? Am I missing some interesting options? ...

Most efficient portable overflow detection?

Possible Duplicate: multiplication of large numbers, how to catch overflow In close to the metal languages like C, C++ and D, what's the most efficient reasonably portable way (i.e. w/o using assembler, though you may assume two's complement arithmetic and wrap-around behavior) to detect overflow of an unsigned 64-bit integer ...

Why does my simple hello world C++ app use 3 threads?

When I look in windows task manage it says it's using 3 threads? Why is this? I was expecting just 1 thread to be used. I used Netbeans IDE and MinGW-Windows g++ to compile it. Thanks Code: #include <iostream> using namespace std; int main() { cout << "Hello World"; int input; cin >> input; return (EXIT_SUCCESS); ...

dll export/import problem in visual studio 2010

I am wrote a visual c++ win32 console app, and i wrote it and tested it in win32 console project . then i switch to win32 project and imported all the source files and created a dll for it. by mark the class i want to export as #define DllExport __declspec( dllexport ) class DllExport theClass { } it works and the d...

How to navigate around and get familiar with large C or C++ code base?

Possible Duplicate: Whats the best way to become familiar with a large codebase? Dear fellow C and C++ programmers, today I got my hands on a new base of code which is around 800,000 lines of code (C and C++ mixed). How do I get familiar with such a huge code? What code browsing tools do you suggest? So far I found only MXR (...

USB controllable display

I'm looking to be able to display status information using a small LED or a small LCD screen connected through USB. All I need to display is very simple status (standby, error, running). Is there anything already made, decent looking and programmable through C++? ...

Badly placed ()'s error

Hello I'm using c++ with embedded SQL trying to receive command line arguments as SQL statements. For instance I want to be able to do: ./a.out proceedings(foo#bar) and tokenize the argument into: proceedings, foo, and bar with #, (, and ) as delimiters. Anyways, I was just wondering if there is a way to use brackets in the argument ...

super minimalist plugin for MS Project: where to get started?

Howdy I was wondering if you could point me in the right direction as far as developing a super simple plugin for MS Project (both 2007, which uses the old style ribbon, and 2010 which uses the new ribbon). What I need to implement: create an executable that installs a new button, with a specific icon, in some per-determined section ...

What is the goal from using "protected"?

Possible Duplicate: Private and Protected Members : C++ Why use the keyword "protected"? What does it mean? ...

How to print boost::any to a stream?

I have a Map std::map<std::string, boost::any>, which comes from the boost::program_options package. Now I would like to print the content of that map: for(po::variables_map::const_iterator it = vm.begin(); it != vm.end(); ++it) { std::cerr << it->first << ": " << it->second << std::endl; } Unfortunately, that is not possible becau...

Which of these is faster?

I was wondering if it was faster to have a std::vector<std::vector<double>>where the nested vector always has 2 elements, or is it faster to have a std::vector<MyPoint>where MyPoint is defined like: struct MyPoint { double Point[2]; }; Thanks ...

Comparing loans with various interest rates

Write a program that lets the user enter the loan amount and loan amount period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8. I have now clue how to do this and would be delighted if someone would explain it better than the book does and dumb ...

C++ base conversion

Hello I'm trying to port some code from Windows to Linux. I have this: itoa(word,aux,2); But GCC doesn't recognize itoa. How can I do this conversion to base 2 on a C++ way? Thanks ;) ...

Asynchronous I/O with Named Pipes WinAPI

Ok, I have asked a few questions about different facets of trying to accomplish what I want to do. This time I'm having big issues just reading from a named pipe. I think I have harvested enough information to possibly complete the project I am working on if I can set this up properly. I will include all relevant code below, but my missi...

C++: Force the order of functions in the virtual method table?

Hello, How can i control the order of virtual functions in the virtual table? Are they laid out in the same order that they are declared in? When inheriting a class with a virtual table, is the virtual table of the inherited class an extension of the base class, or is an entirely new virtual table created with only the inherited classe...

Do I need to protect this variable with a lock?

Hi all, so I have a boolean type in C++ on a multiprocessor machine. The variable starts out life as true, and then there are a few threads, any one or more of which might write it to be false. At the same time, these threads may also read this variable to check its state. I don't care if reading this variable is synchronized with any o...

Multiple std::vectors to fix cache problem?

I have a std::vector<DOUBLEPOINT> I'm making an application with bezier curves and the results are shown in real time. I convert bezier points into a bunch of short lines. I store the coordinates for the small lines in the vector above. Here is my issue:. When the size of my vector exceeds a cache line, things get very slow very fast. I...