Modern book on C++ templates
If I were to buy one and only one book on C++ templates which one would you recommend ? And why ? ...
If I were to buy one and only one book on C++ templates which one would you recommend ? And why ? ...
Is this a valid LinkedList destructor? I'm still sort of confused by them. I want to make sure I'm understanding this correctly. LinkedList::~LinkedList() { ListNode *ptr; for (ptr = head; head; ptr = head) { head = head->next delete ptr; } } So at the beginning of the loop, pointer ptr is set to hold the add...
This is my code map<string,int> persons; persons["B"] = 123; persons["A"] = 321; for(map<string,int>::iterator i = persons.begin(); i!=persons.end(); ++i) { cout<< (*i).first << ":"<<(*i).second<<endl; } Expected output: B:123 A:321 But output it gives is: A:321 B:123 I want it to maintain the order in whi...
Consider the following snippet: class Foo { public: Foo( int Value ); // other stuff }; std::list< boost::shared_ptr< Foo > > ListOfFoo = list_of( 1 )( 2 )( 3 )( 4 )( 5 ); This does not work out of the box. What is the simplest way to make this work, or is there any method to assign values to ListOfFoo as simple as that? ...
Hello altogether, Although it seems to be a very common issue, I did not harvest much information: How can I create a safe interface between DLL boundaries regarding memory alloction? It is quite well-known that // in DLL a DLLEXPORT MyObject* getObject() { return new MyObject(); } // in DLL b MyObject *o = getObject(); delete o; ...
I am using Visual Studio 5.0 I have DLL and a static library . My intention is to use a static function that is defined in the static library . I have included the header file in the intended source cpp and also given the path in the project dependencies . Still it gives me linker errors . Following is the linker error error LNK2019...
main() calls Call_By_Test() function with argument parameter First Node. I have freed the First Node in Call_By_Test() but First node address not freed in main(), why ?. typedef struct LinkList{ int data; struct LinkList *next; }mynode; void Call_By_Test(mynode * first) { free(first->next); first->next = (mynode *)NULL;...
Hello, i have some trouble accessing a dll written in vc++ that exports an interface. First i tried to use classes, but after some google-search i came to the solution, that this i not possible. I just want to make sure, that the plugin interface can accessed, by using other languages like c++. Delphi Interface IPlugIn = interface fu...
Hi, Does anyone know how to clear out the Kerberos ticket cache on the local computer - using managed \ unmanaegd code? Thanks in advance! ...
I am trying to call an unmanaged C++ function, that has a structure as an input parameter. The structure is defined in the header file like this: struct MyStruct { int siOrder; char aaszNames[6][25]; int siId[6]; int siTones[6]; }; I tried to declare the managed struct as following: [StructLayoutAttribute(Layo...
Ok, so I was wondering how one would go about creating a program, that creates a second program(Like how most compression programs can create self extracting self excutables, but that's not what I need). Say I have 2 programs. Each one containing a class. The one program I would use to modify and fill the class with data. The second fil...
I'm writing a small proof-of-concept console program with Visual Studio 2008 and I wanted it to output colored text for readability. For ease of coding I also wanted to make a quick printf-replacement, something where I could write like this: MyPrintf(L"Some text \1[bright red]goes here\1[default]. %d", 21); This will be useful becaus...
anyone used the latest version of cryptopp. i think its 5.6.0. I have a solution working in unix. but in windows I am stuck. Anyone here already using cryptopp 5.6 in vs2008 could you please give very specific instructions on how you compiled this? i have also posted in the cryptopp user groups for an answer. There are some instructions ...
i've a header file called base.h which has all initial display and stuff like, my main aim is to simulate a robot with degree of freedom. class center_rods { public: center_rods() { } void draw_center_rod() { glPushMatrix(); glTranslatef(0,1,0); ...
hi everyone, maybe i'm having stupid question as always, but somehow i can't google out how should I store variables so it's effective. Our teacher on c++ just by the way droped something about how could size of the stored data type affect the speed of storing it (like searching for closest sufficient continuous block of memory) and I w...
I compiled some PHP extention libs (in C/C++) a while back, on my XP platform. I have now moved the sources to my Ubuntu box, and want to build the libs for use on my Linux box. However, I have come accross a number of obstacles: I cant locate phpize (even after installing the php5dev package) I cant find ext_skel to generate the skel...
I am currently writing an application for monitoring SQL queries produced by a web application. I am interested in monitoring the SQL queries being sent by a given application passively. That is, I don't want a proxy - instead I want to run the application to sit separate of the web application / database, and simply read the SQL queries...
I get a crash (i.e. abort) as follows and wanted to know if there's anything that I can get from the memory map information provided that could be useful? ___________ *** glibc detected *** free(): invalid pointer: 0x000000000070f0c0 *** ======= Backtrace: ========= /lib64/libc.so.6[0x7f4f2ee88cb8] /lib64/libc.so.6(cfree+0x76)[0x7f4f...
Is there any way to change the version in a comment block? For e.g. const char VER[] = "1.2.3.4"; /** * \version (VER) */ I know how to do this with preprocessing and I was wondering if there were any other way? On a related note, how do you guys handle changing version numbers in documentation, the application, etc. without chan...
It is known that C++ templates are turing complete. As such it should be possible to output a quine that is essentially rendered at compile time. Does anyone know if such a quine has been written yet or where I could find one. ...