How do i use C++ with Flex?
How can i outsource performance critical stuff to C++. Is there any example ? ...
How can i outsource performance critical stuff to C++. Is there any example ? ...
Exact Duplicate: Do you prefer explicit namespaces or ‘using’ in C++? Which of these is a preferred convention for using any namespace? using namespace std; or using std::cin; using std::cout; or calling the function as and when required in the code? std::cout<<"Hello World!"<<std::endl; ...
How much time would it take to write a C++ compiler using lex/yacc? Where can I get started with it? ...
I'm trying to use partial template specialization on a (non-member) function, and I'm tripping up on the syntax. I've searched StackOverflow for other partial template specialization questions, but those deal with partial specialization of a class or member function template. For a starting point, I have: struct RGBA { RGBA(uint8 ...
I come to know that when many objects shares same data and creation and desturction of objects are expensive then one can go for reference counting . Can anybody give input about how to achieve it for the library class which cant be changed ?. ...
I am an Engineering Student from University Of Mumbai::RAIT. I am learning C++ from "C++ Primer" by Stanley Lipman and using Visual C++ 2008 as IDE. But, my institute and most of the institutes in my University prefer to use Turbo C++(Version 3.0) by Borland International. What arguments can I put against the use of Turbo C++ in my insti...
I am trying to understand a code, here is fragment which is causing confusion: typedef map<int, Person, less<int> > people_map; people_map people; . . . cout << "Erasing people of age 100" << endl; for (people_map::iterator j = people.begin(); j != people.end();) { if (j->second.GetAge() == 100) { peopl...
When an object is created in your main() function, is its destructor called upon program termination? I would assume so since main() still has a scope( the entire program ), but I just wanted to make sure. ...
Does it make sense to use Qt for increasing the productivity in an MFC app, without actually using the Qt user interface system? I am currently looking or a good productivity library for my MFC based application, with useful container classes, string algorithmus, threading classes, I/O classes and so on. The Qt API is very nice in my o...
Hi all I'm a musician and a programmer and would like to create my own program to make music. I'll start with a console application in C++ before I make a GUI. I'm quiet new to C/C++ and know how to make a basic console application and have read about the Win32 API. I was looking into MSDN for multimedia in Win32 applications and I fo...
I have several fastcgi processes that are supposed to share data. The data is bound to a session (a unique session id string) and should be able to survive a server reboot. Depending on the number of sessions, the shared data might be too big to fit into main memory. Ideally, in the case when the shared data exceeds a certain treshold, t...
I am currently designing an application in C++. Part of this application would be displaying changing 3D objects. I have designed several bits of these 3D objects in Blender And also am aware of other programs with which to do this (Maya, etc.) However, I am unsure how to use C++ To display these objects, much less manipulate them in...
Hey, I'm trying to compile someone's code right now and the person is using a variable HZ (which I think stands for Hertz for the hertz of the cpu) but the compiler is complaining that the variable is not defined. My guess is that the person didn't include the correct header file. So does anyone know which header file, HZ is defined in...
I've recalled using little 'filesystems' before that basically provided an interface to something else. For example, I believe there was a GMail filesystem that created an entry in My Computer and could be used like any other drive on your local computer. How can I go about implementing something like this in C++? Thank you! ...
I have some file writing code that works as expected, but prints an error on Debug mode, no output errors in Release. Code: #include <iostream> #include <string> #include <fstream> #include <sstream> using namespace std; int main (int argc, char * const argv[]) { string cppfilename; std::cout << "Please enter the filename to...
Hi! According to following resources, in C++(Specially Visual C++) scoped static variable initialization isn't thread safe. But, global static variables are safe. http://stackoverflow.com/questions/1052168/thread-safe-static-variables-without-mutexing http://blogs.msdn.com/oldnewthing/archive/2004/03/08/85901.aspx So, is following co...
Hi, I have a buffer class in my C++ application as follows: class Buffer { public: Buffer(size_t res): _rpos(0), _wpos(0) { _storage.reserve(res); } protected: size_t _rpos, _wpos; std::vector<uint8> _storage; } Sometimes using the constructor fails because its unable to allocate the required memory ...
Hello! What's better from a performance point of view std::map<uint32_t, MyObject> or std::map<uint32_t. MyObject*> if MyObject is 'fat' (that is operator= rather expensive) and I have to insert/update/delete a lot ? ...
hi, how to inform the server that is a client is interrupted, and close the socket? Thanks! ...
Hi, I was recently asked to write a program, that determines whether a number is even or odd without using any mathematical/bitwise operator! Any ideas? Thanks! ...