c++

C++ main() in a large OOP project

This may be a short & simple question, but I've never found a satisfying answer to it: What code does the main() function usually consist of in a large C++ project? Would it be an incorrect assumption to think that it is usually just initializing a (wrapping) class object and calling a function inside of it to set things off? Why is ma...

How to have a char pointer as an out parameter for C++ function

I'm a newbie to C++. I'm trying to have a char pointer as an out parameter for a function. But the changes made in the function are not reflected in the main function. What am I doing wrong? void SetName( char *pszStr ) { char* pTemp = new char[10]; strcpy(pTemp,"Mark"); pszStr = pTemp; } int _tmain(int argc, _TCHAR* argv[]...

c++ memory allocation question

im trying to create an array: int HR[32487834]; doesn't this only take up about 128 - 130 megabytes of memory? im using MS c++ visual studios 2005 SP1 and it crashes and tells me stack overflow. ...

C++ Fast way to convert between image formats

Ive got some in memory images in various simple formats, which I need to quickly convert to another format. In cases where the target format contains an alpha channel but the source does not, alpha should be taken as its full value (eg 0xFF for an 8bit target alpha channel). I need to be able to deal with various formats, such as A8R8G8...

Which is more secure OFB or CFB?

I'm working a small project, using AES encryption and wanted to use it in streaming mode, which is considered a more "suitable" mode for socket usage? OFB or CFB? I've been reading about it and can't really decide, so any ideas are highly appreciated. I'll be using OpenSSL/C++. ...

Hierachical data in TreeViews and TreeView updating technique

I have lots of (hierachical) data that I show in a TreeView (could be around 20K items or more, including children items). The peculiar problem with my data is that each object shown in the treeview can exist in many treeview items. What I mean by that is that I might have an hierarchy like this one: Item_A -> Item_B -> ItemC Item_B ->...

Using libxml2 in Visual Studio 2008 and Windows XP

I have a weird problem when running an application that uses GNOME's libxml2 under Visual Studio 2008 (VS2008-SP1) and Windows XP. I have two C++ projects: Project A (a library) Project B (an application that depends on Project A) Both under one VS solution. Project A is statically compiled with libxml2.lib. I've added dependencie...

Undefined Reference to class function issue

Hello. I've scoured the internet and my own intellect to answer this basic question, however, much to my own dismay I've been unable to find a solution. I'm normally pretty good about multiple header files however I have hit a wall. The problem is a function that I've declared in a header and defined in its proper namespace in the source...

I can't understand the usage of the normal class libraries of the Java

I'm a beginner at Java Programming. I have the experience that I used DX library for before in C++. The DX library worked with simple functions, but the library of the JAVA does not work with functions. How can I understand Java Class libraries? ...

Rotating a spaceship model for a space simulator/game

I been working on a space sim for sometime now. At first I was using my own 3d engine with software rasterizer. But I gave up when the time for implementing textures was due. Now I started again after sometime and now I'm using Opengl (with SDL) instead to render the 3d models. But now I hit another brick wall. I can't figure out how ...

Convert LPCOLESTR to BSTR?

Any ideas on how to make a BSTR out of an LPCOLESTR? Silly thing to get hung up on.. ...

Does a "pure" IDispatch interface require a proxy/stub DLL?

..for an out-of-process-server, or can I call a dispatch interface without registering a proxy/stub? The interface in question is very high level, so performance is a non-issue, and I could make the whole thing registration-free, which is a big plus ...

Best C++ Debugger For Linux

I'm learning C++ and I want to know what is the best C++ debugger for Linux, because there are some things, that is better to use a debugger to get here in Stack Overflow and ask very very simple questions that can be easily solved by a debugger. Also, there is any book to learn how to use this debugger? ...

Issue regarding size_t

If you go in my post history you'll see that i'm trying to develop an interpreter for a language that i'm working on. I want to use *size_t* using two different codes, but they all return nothing. Here is the post of what i was trying: http://stackoverflow.com/questions/1215688/read-something-after-a-word-in-c When i try to use the ...

interrupt program in debugger when c++ exception is thrown

How can I make gdb interrupt (like in breakpoint) the program at the point where an exception is thrown, and interrupt again on rethrows and beginnings of the relevant catch blocks? ...

Provide program arguments when debugging with Code::Blocks

I cant seem to work out how to add program arguments to the launch command for the codeblocks debugger. Any one know how to do this? ...

Code::Blocks not being able to find standard library headers?

I recently switched from Bloodshed to Code::Blocks. I wrote a simple input/output program to get a feel for it, and when I tried to compile it I got errors for all of the headers I had included, saying that there was no such directory. I took a look at the file and saw that the file was saved as a C file rather than a C++ file, how do I...

Parsing XML Encoded in UTF-8

I am working with a Wikipedia XML dump that is encoded in UTF-8. Right now, I am reading in everything as std::string, so when I std::cout to the screen, foreign characters are displayed as jibberish. The actual parsing process only looks for ASCII characters though, but when I write the parsed file to disk, I want to preserve the fore...

what are the options i have to write smtp client in c++ ( cross platform)

Hello all i need to add the ability in my application to send emails ( with the user's email server/service ) for that i need to wirth or to use smtp c++ lib or code in which i have no idea where to find . where can i find free lib or source code that i can use or learn from . can you please help me on this subject Thanks ...

How to convert Win32 HRESULT to int return value?

I'm writing a Windows console application in C++ and would like to return zero on success and a meaningful error code on failure (i.e., S_OK should return 0, and E_OUTOFMEMORY should return a different return value than E_FAIL and so on). Is the following an okay approach?: int wmain(int argc, wchar_t *argv[]) { HRESULT hr = DoSomet...