i want to write code in data structure using c++. my topic is online voting system.

Member Avatar
Member Avatar
+0 forum 3

Pretty neat text-based RPG that I made. Currently my first game.

Member Avatar
Member Avatar
+0 forum 18

The snippet shows how to create a menu on a windows form and test it. Original code via BCX, modified to compile with Dev C++ as a Windows Application. This approach does speed up writing of GUI programs.

Member Avatar
Member Avatar
+1 forum 2

Hey, i was just mucking around and improving my code etc and made a calculator, it's not the best calculator in the world, it only can handle 1 or 2 numbers but i think it's good my self :).

Member Avatar
Member Avatar
+0 forum 8

Well inside the windows operating system there are predefinided dialog boxes. We can use it freely with little effort. Think that you have to get a input file name or file path. The traditional way of doing this is parsing the command line arguments.But here we are in win32 , so we should use GetOpenFileName simple GetOpenFileName just getting an pointer to a data structure OPENFILENAME that defined on Commdlg.h header file. so we just create that structure on the memory and passing pass it's pointer as an argument to the GetOpenFileName function. and after that returns it normally fills …

Member Avatar
Member Avatar
+0 forum 5

This is a remake of the Simple Equation Solver snippet that is written in Java. This is an equivalent version written in C++.

Member Avatar
Member Avatar
+1 forum 7

A little calculator written in BCX basic and then translated to C code and modified to compile with Dev C++ (GCC/G++). Once you find your way past the standard GUI gibberish you can figure it out. For those who need some hand holding with the Dev C++ IDE: In the IDE go to FILE, then NEW, then Project, select Windows Application, give it a name like Calc1 then click OK. A filesave dialog box comes up, create a new folder, might as well call it Calc1, open it and save Calc1.dev there. The DevCpp IDE comes up with a bare …

Member Avatar
Member Avatar
+1 forum 8

A program that uses hooks to detect keypresses and write them to a file.

Member Avatar
Member Avatar
+0 forum 20

What "Hello World" is to the console, the "Bouncing Ball" is to the Graphical User Interface. Nothing fancy, the ball is created via a call to the API function ellipse() and then bounced within the confines of the windows form. For the DEV C++ crowd: Let me know if you find these snippets somewhat helpful in your learning process in the comments section at the end.

Member Avatar
Member Avatar
+1 forum 22

when the console displays the "StudentAns" I get weird characters instead of the actual answer. ///////////////////////////////////////////////////////////// this is the files CorrectAnswers.txt A D B C A A D B D C A D B A C C D B C A StudentAnswers.txt A D B C A A D B D C A D B A C C D B C A

Member Avatar
Member Avatar
+0 forum 1

This snippets contains a python program to find a shortest solution to the problem of the farmer who whishes to cross a river. The boat can only contain two things, including the rower. The farmer comes with a wolf, a duck and a bag of corn, and he can't leave the duck alone with one of the other items because the wolf would eat the duck, or the duck would eat the corn. The program shows how to use a `collections.OrderedDict` to implement a stack without repetitions. This is used to traverse a tree of states. These states, encoded as …

Member Avatar
Member Avatar
+0 forum 5

void Halt (); void Reply (const char * num,uint8_t stat); { this is the error message for this code 7|error: 'uint8_t' has not been declared 9|error: expected unqualified-id before '{' token

Member Avatar
Member Avatar
+0 forum 3

This program displays a simple analog clock to show the current system time. Uses a Hand class to create objects - hour, minute and seconds hands.The 'hands' are just straight lines, and two circles make the 'frame' of the clock. Compiles correctly on TurboC++ v3.0

Member Avatar
Member Avatar
+0 forum 5

This is a program for Encryption and Decryption This program uses the Simple Data Encryption Standard (SDES) Algorithm. This Algo takes 8-bits of plaintext at a time and produces 8-bits of ciphertext. It uses 10-bits of key for Encryption and Decryption.

Member Avatar
Member Avatar
+0 forum 5

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. This snippet may appear much slower because of the amount of CPU it's applying to each pixel, but the blitting itself is very fast. Also, don't forget that an average game will only redraw parts of the window that need redrawing, this redraws the whole surface every time. So, as …

Member Avatar
Member Avatar
+1 forum 13

This is a program I just recently completed for a computer science course. Given a 2D grid, where every path between two gridpoints has a weight (path length) associated with it, this program computes the shortest path from (1,1) to (m,n). You are only allowed to move up and to the right (so no, it's not Dijstra.)

Member Avatar
Member Avatar
+0 forum 3

[B][COLOR="Red"]Simple C++ program for age calculation[/COLOR][/B] [COLOR="Green"][B]NB:Excuse me experts,,this is only for beginners.........[/B][/COLOR] Instructions//// 1.Copy the code 2.paste it in a text file 3.save the text file as agecalc.cpp and select file type all with in the text file. 4.paste this file inside your bin folder where the Turbo C resides. 5.Open turbo C and do File->Open->Agecalc.cpp 6.press F2 to save and F9 to compile. 7.press ctrl+F9 to run the program 8.once you have compiled the program search for agecal.exe in your bin folder

Member Avatar
Member Avatar
-4 forum 14

I am totaly new to C++, and i am trying to get sum of two digits, but i am getting some error, will somebody please correct my code. Regards

Member Avatar
Member Avatar
+1 forum 4

Test void try() { cout << test; }

Member Avatar
Member Avatar
+0 forum 5

Hi all, I was just playing around with some ideas about optimizing a core piece of my library: the run-time type identification system (RTTI). What does that have to do with compile-time string concatenation? Well, the whole point of the RTTI is to provide information on the type of objects, and a string representation of that name is a pretty central part of that (as well as a hash value). Type names are made of identifiers, which are names that are known at compile-time, and could thus be compile-time string literals (that means things like `"Hello world!"`). The problem is, …

Member Avatar
Member Avatar
+6 forum 6

The user is asked to input a number in either Hex, Octal or Decimal, which is then converted to Hex, Octal & Decimal. The user can exit the program from the MAIN MENU or by the Escape key after each convertion. Compiler : Borland Turbo C++ v4.5.

Member Avatar
Member Avatar
+1 forum 8

Here is a simple Polynomial class. Its purpose is to show how one can [B]simply [/B]create a Polynomial class without using abstract datastructures such as linked lists etc. Each term is printed out in order of its power - from highest to lowest. Inspiration was taken from a Java source code, the link appears to now be dead.

Member Avatar
Member Avatar
+2 forum 9

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!

Member Avatar
Member Avatar
+1 forum 2

This AVI file player has some nice features like adjusting size and speed. The program uses the standard MSvfw32.lib (called libmsvfw32.a in the DevCPP lib directory). Another example of using BCX to translate to C code and modify to something Dev-C++ can handle. Enjoy!!!

Member Avatar
Member Avatar
+0 forum 9

Code will check whether the number entered is integer or not. [inlinecode]ignore[/inlinecode] extracts characters from the input sequence and discards them. The extraction ends when max characters have been extracted and discarded or when the character delim(\n) is found, whichever comes first. In the latter case, the delim character itself is also extracted. [inlinecode]numeric_limits<int>::max()[/inlinecode] - Returns the maximum finite value for integer. [inlinecode]gcount[/inlinecode] - returns the number of characters extracted by the last unformatted input operation performed on the object.

Member Avatar
Member Avatar
+0 forum 5

Here is an example on how to put at least lines and circles onto your windows console display. Yes, you have to jump through a hoop to do it. Dev-C++ can do this thanks to some BCX generated code. You have to set up your project as a Console Application and link with libgdi32.a in the case of Dev-C++, or GDI32.lib with other compilers.

Member Avatar
Member Avatar
+0 forum 8

This is a timer class that I wrote a while ago (cleaned up a bit for the snippet) for adding delays in some of the games I have written over the years. Note: I normally have the class functions in a .cpp file but since it looks like I can only post in one "file" I merged them together in what would be a .h file. The timer basically counts up in miliseconds and can be paused/resumed while maintaining the amount of miliseconds elapsed while the timer was active. Here is a basic example of counting from 1 to 10 …

Member Avatar
Member Avatar
+0 forum 10

This is a basic CPP sleep fuction. As you can see CPP libs do not come with a time sleep/wait fuction to use in your code/loop. So due to boring jurney to Saint Petersburg, i decided to write something/code to give anyone who has been wondering why CPP does not consist of that function. The idea is nice because there are at least 5 ways to achieve this results. I always like the easy and straight forward ones. Have a look at the code below. I will starting a QT GUI full tutorials in the next few days. Everything QT …

Member Avatar
Member Avatar
+0 forum 12

Creating WinAPI windows and controls can be a pain and quite difficult/annoying at times. Most of the time, I find myself searching MSDN, DaniWeb, and StackOverflow. I hate having to use external libraries unless I absolutely have no other choice. Below contains code for creating WinAPI windows, Controls, Sub-Classing, and EventHandling for each control. There is a sample working code below this article and an image of what the sample code produces. There are only 4 files to include to your projects: Form.hpp -- Form.cpp Controls.hpp -- Controls.cpp The code for these files are as follows: Form.hpp: #ifndef FORM_HPP_INCLUDED #define …

Member Avatar
Member Avatar
+0 forum 5

Just use the SetTimer function after you Create the window , and just handle the WM_TIMER message inside the message loop. That's it !

Member Avatar
Member Avatar
+0 forum 4

The End.