c++

Compile error related to "index"- is it actually a function?

I'm removing all warnings from our compile, and came across the following: warning: the address of ` char* index(const char*, int)', will always be 'true' for the following line of code: DEBUG_MSG("Data received from Device "<<(int)_nodeId << "for" << index <<(int)msgIn.index<<"."); DEBUG_MSG is one of our logging macros that th...

Cppunit; trying to compile class to test

I am quite new to both C++ and Cppunit. I am trying to compile a little cppunit test. However, I do not succeed. qwerty@qwerty:~/chessgame/src$ g++ -Wall CoordinateTest.cpp ftest.cpp -lcppunit -o test /tmp/cc1vJJqz.o: In function CoordinateTest::coordinateTest()': CoordinateTest.cpp:(.text+0xbb): undefined reference to Coordinate::Coord...

C++/CLI Converting from System::String^ to std::string

Can someone please post a simple code that would convert System::String^ to C++ std::string ? i.e I just want to assign the value of String^ originalString; to std::string newString; ...

What if any, programming fundamentals are better learned in C as opposed to C++?

As a person who wanted to increase his fundamental programming skills, I chose to learn C++ instead of C. Which leads me to ask: Is there any fundamental skills that I leave in C that might not be obtained by learning C++? Related question: Should I learn C before learning C++? ...

What's the best portable way to represent pointer as string in C++?

I need to represent pointers as strings to the user. Sometimes the values might be saved to a file and transferred to a computer with different architecture (32 vs 64 bit is the main issue currently) and loaded from text file to be compared - I'm only going to compare loaded values with each other, but I'd still prefer to compare numbers...

What does the PIC register (%ebx) do?

I have written a "dangerous" program in C++ that jumps back and forth from one stack frame to another. The goal is to be jump from the lowest level of a call stack to a caller, do something, and then jump back down again, each time skipping all the calls inbetween. I do this by manually changing the stack base address (setting %ebp) and...

What is the point of make_heap?

Can someone please tell me the point of the STL heap functions like make_heap? Why would anyone ever use them? Is there a practical use? ...

Asynchronous OLE Drag & Drop possible?

I wonder if anyone knows if there's any way to start OLE file drag from a C++ Win32 application without blocking until the drag completed. I'm currently using DoDragDrop() to start the drag operation, but this function doesn't return until the drag operation is completed. The problem with this is that the animation in my program halts w...

Does a standard implementation of a Circular List exist for C++?

I want to use a circular list. Short of implementing my own (like this person did) what are my options? Specifically what I want to do is iterate over a list of objects. When my iterator reaches the end of the list, it should automatically return to the beginning. (Yes, I realize this could be dangerous.) See Vladimir's definition ...

C++ long to string

Yes, it is for homework.... Anyway - how to convert long into string? THANK YOU! ^^ ...

C++ class instances

I am working on intro c++ homework, but I am stuck. Account *GetAccount(int an); int main() { Account *a1,*a2,*b1; a1=GetAccount(123); a2=GetAccount(456); b1=GetAccount(123); if(a1==b1) cout<<"YES"<<endl; else cout<<"NO"<<endl; GetAccount method is supposed to check whether the instance already exists with the same account number...

debug command line application

I'm wondering if it's possible to debug a command line application (where main received arguments argc, and **argv) in visual studio 2008? ...

Lua / c++ problem handling named array entries

I'm trying to write some c++ classes for interfacing with LUA and I am confused about the following: In the following example: Wherigo.ZCommand returns a "Command" objects, also zcharacterFisherman.Commands is an array of Command objects: With the following LUA code, I understand it and it works by properly (luaL_getn returns 3 in the ...

debug assertion error

I've been scratching my head for quite some time now, this code worked fine when I first used cmd to go inside the project\debug folder then run the program there. Then I added the if(in) and else part then it started giving me "debug assertion failed" errors mbstowcs.c Expression s != NULL It just doesn't make any sense to me.. I us...

Template specialisation where templated type is also a template

I've created a small utility function for string conversion so that I don't have to go around creating ostringstream objects all over the place template<typename T> inline string ToString(const T& x) { std::ostringstream o; if (!(o << x)) throw BadConversion(string("ToString(") + typeid(x).name() + ")"); return o.str...

How to teach C++

My wife receintly asked if I could teach her to program. I think the best lang to teach in is C++ (please don't argue that point, it's what I learned on and what I know best). Other then the C++ tutorial on the C++ website, what else would you give a brand new programmer. I'm thinking boolean math, but other than that I can't think of ...

String Problem in C++

I have problem in string maniputation with c++. The Rule : if the same 'word' is repeated from sentences or paragraph i want it to become an integer. Please help me ?! example input : we prefer questions that can be answered, not just we discussed that. output: 1 prefer questions 2 can be answered, not just 1 discussed 2. 1 we 2 th...

what are the phases in build process

What are the different phases or stages involved in builing an executable (compilation,linking...)? is it differen in .Net application and windows application ...

Tree parsers for compilers written in C++

I'd like to find a tree parser generator to help me transform ASTs for a compiler written in C++. After some quick research I found out about ANTLR (which can be targeted to work with C but not C++). I also found a website that warns against using ANTLR with C++: http://www.bearcave.com/software/antlr/antlr_treeparse.html. The article...

DLL exporting only certain templatized functions.

Hey all, so this seems to be a rather strange issue to me. I have a very simple templatized container class which is part of a DLL. The entire class is defined in a header file, to allow automatic template generation. Now another part of the DLL actually requests a certain template type to be generated, so the code should exist within th...