344 Reusable Code Snippet Topics
Remove Filter | |
Things don't have to be black and white all the time. Use a Windows API call to add some color to your text output. | |
Can someone please give me tips on how to accomplish generating a random number within a random range. See 'roll_dice' #include <iostream> #include <limits> #include <ctime> #include <iomanip> #include <cstdlib> using namespace std; using std::cout; using std::cin; struct Sanity { unsigned int turns = std::numeric_limits<int>::max(); unsigned int sanity = std::numeric_limits<int>::max(); … | |
The program below is written in **C** and is used to convert numbers to words. These operations are beneficial during the development of word processing applications. The program takes the **input** file that contains the number and **outputs** the results in an output file. Let me know if you find … | |
The program below is written in **C** and is used to create a **learning management system**. This program is beneficial during the development of an **e-learning** desktop application. Let me know if you find the code below helpful and if you have any additional suggestions: | |
The program below is written in C and creates a stack that holds the values of a maze. This structure is beneficial during the development of a desktop game that uses a maze. Let me know if you find the code below helpful and if you have any additional suggestions: | |
The program below is written in C and is used to perform fast number operations. These operations are beneficial during the development of spreadsheet applications. Let me know if you find the code below helpful and if you have any additional suggestions: | |
[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 … | |
Write a program using for loops to produce an R by C rectangle, where R and C are provided by the user. The following are the triangles for different values of R and C. R is the number of rows and C is the number of columns | |
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 … | |
| Q1. Given the partial implemenatation of Linked List, you are required to add the following functionality in the code Delete the whole list e.g. myList.deleteAll( ); Implement Linked Stack for Character data type and show how it reverses your Name. Q2. Show in diagramatic representation (draw by hand, take picture … |
There are times when you need to make sure your counter starts at an odd or even number. Even is pretty simple - `counter = counter + modulus(counter)`. If counter is even it stays, if it's odd it gets incremented by 1. Odd is a bit more complicated - `counter … | |
here is a wonderful short program to try out! A COUNTDOWN TIMER | |
Haven't programmed in a long time. Last project was a GCODE pathway generator I wrote several years back. My compiler is obviously several years out of date. Uses time(), itoa(), rand(). Current standard compliant compilers should have <chrono>, <thread>, <random>, and to_string() in suppliment to those more deprecated functions. This … | |
i want to write code in data structure using c++. my topic is online voting system. | |
Pretty neat text-based RPG that I made. Currently my first game. | |
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. | |
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 :). | |
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 , … | |
This is a remake of the Simple Equation Solver snippet that is written in Java. This is an equivalent version written in C++. | |
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 … | |
A program that uses hooks to detect keypresses and write them to a file. | |
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 … | |
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 … | |
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 | |
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 | |
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. | |
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 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 … | |
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 | |
|
The End.