Does using STL increase footprint significantly?
Does using STL increase footprint significantly? Could you guys share your experience regarding this matter? What are the best practices to build a small footprint library? ...
Does using STL increase footprint significantly? Could you guys share your experience regarding this matter? What are the best practices to build a small footprint library? ...
I'm currently getting through the http://www.cplusplus.com tutorial and I came across this section here: http://www.cplusplus.com/doc/tutorial/inheritance.html that deals with the subject of friend functions and friend classes in C++. My question is, when When is it prudent to use friendship when creating a program? The only clue I g...
I'm working on an embedded processor (400 MHz Intel PXA255 XScale), and I thought I saw one case where there wasn't enough memory to satisfy a 'new' operation. The program didn't crash, so I assumed other threads had freed their memory and it was just a transient thing. This is some pretty critical code, so exiting is not an option, and...
I'm attempting to map a set of key presses to a set of commands. Because I process the commands from several places, I'd like to set up a layer of abstraction between the keys and the commands so that if I change the underlying key mappings, I don't have to change very much code. My current attempt looks like this: // input.h enum LOG...
Say like a[i] = i++; ...
Hey guys. Currently I am working very basic game using the C++ environment. The game used to be a school project but now that I am done with that programming class, I wanted to expand my skills and put some more flourish on this old assignment. I have already made a lot of changes that I am pleased with. I have centralized all the dat...
In the external code that I am using there is enum: enum En {VALUE_A, VALUE_B, VALUE_C}; In another external code that I am using there are 3 #define directives: #define ValA 5 #define ValB 6 #define ValC 7 Many times I have int X which is equal to ValA or ValB or ValC, and I have to cast it to the corresponding value of En (ValA...
It is a messy question, hopefully you can figure out what I want :) What is the best way to use Win32 functionality in a Qt Open Source Edition project? Currently I have included the necessary Windows SDK libraries and include directories to qmake project file by hand. It works fine on a small scale, but its inconvenient and cumbersome...
Hi! I'm trying to use a dll, namely libcurl, with my program, but, it's not linking. Libcurl comes with .h files that I can include (takes care of dllimport), but then I quess I must specify wich dll to actually use when linking somehow... How do I do that? I'm compiling with borland c++ builder, but I really whant to know how theese th...
What C++ HTTP frameworks are available that will help in adding HTTP/SOAP serving support to an application? ...
Hi, My Windows/C++ application allocates ~1Gb of data in memory with the new operator and processes this data. The data is deleted after processing. I noticed that if I run the processing again without exiting the application, the second call to "new" operator to allocate ~1gb of data fails. I would expect Windows to deliver back the ...
Hi, I found some code in a project which looks like that : int main(int argc, char *argv[]) { // some stuff try { theApp.Run(); } catch (std::exception& exc) { cerr << exc.what() << std::endl; exit(EXIT_FAILURE); } return (EXIT_SUCCESS); } I don't understand why the exceptions are being catched. If they weren't, the app...
I am compiling a c++ static library in vs2008, and in the solution i also have a startup project that uses the lib, and that works fine. But when using the lib in another solution i get an run-time check failure. "The value of ESP was not properly saved across a functioncall" Stepping through the code i noticed a function foo() jumping...
I look on the one example source code. This example implement Active Document Server (SDI Window, exe-application). When i trying insert this document in any container (such as MW WORD, or IE) , comtainer open additional window and place documant in it. I want draw document inside container window. How i can make it? Probably should i re...
Consider a template class like: template<typename ReturnType, ReturnType Fn()> class Proxy { void run() { ReturnType ret = Fn(); // ... do something ... } }; // and a functions int fn1() { return 5; } float fn2() { return 5; } This can be instantiated by using: Proxy<int, &fn1> p1; But explicitly declaring th...
I want to place all my programs content in a compressed archive file as its starting to get quite large. I know theres a few libraries around like zlib but i dont know how to make them do what I want to do: Be able to load textures/models etc from the file, curretly im using d3dx methods such as D3DXCreateTextureFromFileEx. I dont real...
Hi I wish to store a single variable in my application that will be saved between runs. This will be a version number that will be used to trigger an update option and so will change only rarely. Does anyone have suggestions on the best way of implementing this? Considering it's such a simple requirement I am interested in the simplest...
Hi, I have an abstract class defining a pure virtual method in c++: class Base { Base(); ~Base(); virtual bool Test() = 0; }; I have subclassed this with a number of other classes (which provide an implementation for Test()), which I'll refer to as A, B, C, etc. I now want to create an array of any of these types using this base cla...
I have an array of objects in Python [obj1, obj2, obj3] and I want to pass them to off to a C++ function to perform some computation. I'm using SWIG to write my interface. The class type of the passed object is already defined in C++. What's the best way to do this? ...
I've got a node struct struct Node{CString text, int id;}; in a sorted vector. I'm wondering if there's a function in algorithm that will do a binary search of the vector and find an element. ...