22 Archived Topics
Remove Filter Hi all, I'm a very early user of Daniweb, and after a long break, and I'm hoping to participate a bit more in this forum again. I'm here specifically for some advice before starting a new project of mine. I'm an experienced C++ / Win32 developer, but seem to be … | |
A program that uses hooks to detect keypresses and write them to a file. | |
I'm working on a program that requires some very low level optimization. My question is, when precision isn't an important factor, how can I automatically use the most efficient floating point type for whatever architecture the program is being run on? As far as I'm aware, floats are more efficient … | |
Quite a while ago, I made [URL="http://www.daniweb.com/code/snippet217147.html"][B]this[/B][/URL] snippet. This code is basically the same, except that it adds animation. This method of blitting is very fast assuming you don't use a surface that's too large. On a 500 x 500 surface, I managed 350fps using only 0-1% of the cpu. … | |
Hi, thanks for any help in advance. I was hoping to get some guidance for getting started with connecting to an SQL database online. I'm writing an application in Win32 which needs to be able to read/write to a database. I have plenty of experience with C++, but almost no … | |
Saw [this](http://www.daniweb.com/software-development/cpp/code/216430/add-a-little-graphics-to-your-console) and decided to make a little spinoff with some physics of mine. Enjoy! | |
| |
A small game of pong I put together in about half an hour :) Enjoy. | |
Heres a code that allows you to manually change the sensitivity of the mouse by using windows hooks. | |
Hi, I've been working on a sudoku game, which seems to be working pretty well so far. I've managed to make a basic solver, and the interface is pretty nice :icon_cheesygrin: But i'm having problems trying generate a random unique sudoku. I need to be able to create 3 different … | |
Here's a function that manually converts an integer to any base between 2 and 36, the parameter list is: [CODE]void toBase( int value, // Integer value to convert char *target, // Pointer to a large enough buffer int base, // Base (from 2 to 36) int fixedDigitCount // The minimum … | |
This snippet basically shows you how to input a password from the user without actually displaying the characters, instead they are replaced with the ' * ' character as you type. The code is uncommented, so I will briefly explain it. This function: [ICODE]void PasswordInput(char *password, size_t maxLength)[/ICODE] has two … | |
Snippet to show how to count the number of occurences of letters in a string. | |
This snippet shows how you can manually split up a sentence using multiple delimiters. In this example, I split up this sentence: [ICODE]"Hello, my name is william!"[/ICODE] into the following: [ICODE]"Hello"[/ICODE] [ICODE]"my"[/ICODE] [ICODE]"name"[/ICODE] [ICODE]"is"[/ICODE] [ICODE]"william"[/ICODE] As you can see, the delimiters are not included ([ICODE]" ,!"[/ICODE]) | |
Heres a snippet that allows you to make your own images by using a mathematical formula. It gives you fast access to each pixel in the bitmap, and then saves the image as a [B].bmp[/B] once its made. You can be creative like this and make images which would be … | |
Heres a snippet that compares the speed of volatile (nonregister) variables, and register variables and display's the average cycle count for each. This shows you exactly how much using registers speeds up loops and calculations. I get the following output, but it may vary: [QUOTE]Cycle count for nonregister integer: 8 … | |
This snippet shows how to use hooks to stop the cursor from entering a certain area of the screen. This example will stop the cursor from going over 300 pixels away from the centre of the screen by using a bit of maths. | |
Hey, Here is a program I made which has interested quite a lot of people over the past few weeks, so I figured I would share it :) Using a small amount of trigonometry you can create some very fascinating shapes and effects. But in order to draw anything you … | |
Hi everyone. Here is a program I made which will find patterns in a list of primes. It does this by finding the difference between each prime and adding them to a vector like this: [CODE] Primes: 2 3 5 7 11 13 ^ ^ ^ ^ ^ Difference: 1 … | |
Hi I have a small question, probably quite obvious but I cant seem to figure it out. When using the ifstream or any other stream you can tell if it was sucessfull in its last event. For example: [CODE=CPP] #include<fstream> int main() { ifstream in("test.txt", ios::in); if (in) { } … | |
Hi I am trying to make function which returns a substring as a [ICODE]char*[/ICODE], but [ICODE]string::substr[/ICODE] returns a [ICODE]const char*[/ICODE]. So I have managed to make a function that will return a substring as [ICODE]char*[/ICODE], except when I was comparing the speed of the two, I found that [ICODE]string::substr[/ICODE] was … | |
Hi I have a memory leak somewhere in this code but I have no idea where. Can anybody help me out ? [CODE] #include <windows.h> #include <mmsystem.h> #pragma comment(lib, "winmm.lib") #include <fstream> #include <time.h> #include <cstring> #include "resource.h" using namespace std; const char cn[] = "SameGame"; // ClassName HBITMAP BLUEBMP … |
The End.