String to int in C++

This is simple but mighty annoying if you’re not used to C++, like I am. I am a C# coder, but working with C++ at the moment and sometimes it can get confusing. So I am writing this to remember it for future usage. int atoi ( const char * str ); str : string Continue reading →

June 23rd, 2010 by Marcus 

Int to String in C++

This is simple but mighty annoying if you’re not used to C++, like I am. I am a C# coder, but working with C++ at the moment and sometimes it can get confusing. So I am writing this to remember it for future usage. char *  itoa ( int value, char * str, int base Continue reading →

June 23rd, 2010 by Marcus 

Search for C++

To make my life simplier i made my custom google search tool to find c++ help, only in selected places. That way I won’t need to browse through dozens of forums and sites. So far i’ve added a few sites, but I will keep adding good resources as soon as I find them. If you Continue reading →

June 16th, 2010 by Marcus 

Stop “PlaySound()” in c++

So today I got into the problem of how to stop playing a soundfile that was started with Playsound with the SND_ASYNC parameter. PlaySound(“MySound.mp3″,NULL,SND_FILENAME || SND_ASYNC); Well, the solution was simple PlaySound(NULL, 0, 0); Well, that figures… …continue reading.

May 26th, 2010 by Marcus 

Sound in C++

Yesterday I learned how to play sounds with C++. This is the normal way to play a sound file. PlaySound(“chimes.wav”, NULL, SND_FILENAME); That works fine, until you need to control the sound volume. For that you need the Winmm.lib, which provides you with those two functions. MMRESULT waveOutSetVolume(HWAVEOUT hwo, DWORD dwVolume); MMRESULT waveOutGetVolume(HWAVEOUT hwo, LPDWORD Continue reading →

May 19th, 2010 by Marcus 

C++ Arrays

Just so I don’t forget… //Simple array int Monkey[10]; int Banana[] = {23,18,10,10,8,2,3,2,2,3}; // Set value Monkey[5] = 42; Banana[3] = 123571113; // Get value cout << Monkey[5] << ” eats ” << banan[3] << ” bananas.” < OK, so far so good, no difference from C# here… But this is different // Dynamic declaration Continue reading →

May 12th, 2010 by Marcus 

C++ queue

How to use queue: http://www.sgi.com/tech/stl/queue.html More information about the subject http://www.cppreference.com/wiki/stl/queue/start Thanks Roger for the links …continue reading.

May 12th, 2010 by Marcus