51,593 Topics

Member Avatar for
Member Avatar for banders7

Programming Environment: Windows XP Compilers: Borland C++ Builder 6 (Personal)/Borland C++ 5.5 (freebie) This is a routine that queries the logical drives in the system, along with their device types, local/network status and whether or not the devices are removable. Once the data are gathered, the caller's selection parameters are …

Member Avatar for banders7
0
183
Member Avatar for Alex Edwards

Hmm this implementation is a bit bulky and unnecessary, but it was required as a project for one of my classes. Programming perspective: You'll notice in the code that I'm still fairly new to manipulating streams directly in C++, but I am trying my best =P. The StandardIncremental overhead could …

Member Avatar for Alex Edwards
0
197
Member Avatar for William Hemsworth

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 …

Member Avatar for Prabakar
0
1K
Member Avatar for Alex Edwards

Simple program that returns a vector of string elements based on the string argument and the token specified.

Member Avatar for Alex Edwards
0
183
Member Avatar for William Hemsworth

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 …

0
148
Member Avatar for ArkM

CPU Performance Counter based clock and stop-watch classes for Win2K++ were implemented in VC++. Details: see sources (I hope, these classes, especially StopWatch, have well-to-do interfaces;)). Warning: no special precautions for multi-threading/multi-core CPU environment. It's not so hard work to translate these codes in C (or other C++ implementations). This …

0
175
Member Avatar for JLChafardet

this is the other part of my 2nd semester, first quarter project for programming 2. a simple function to convert from arabic numbers to roman numbers.

Member Avatar for JLChafardet
0
218
Member Avatar for JLChafardet

This code was part of my first quarter 2nd semester project for a subject called programming 2. its a simple roman to arabic convertion function.

Member Avatar for JLChafardet
0
309
Member Avatar for JLChafardet

This code is an example of a simple bubble sort function in C++. the function doesnt receive or returns nothing just for the record, some translations "declaracion de constante" = constant declaration "prototipo de funcion" = function prototype "arreglo" = array "Arreglo en el orden original" = original array order …

0
207
Member Avatar for iamthwee

Well technically it isn't an anagram finder, more of a word descrambler program. It is useful for games like scrabble etc. All you need is a dictionary file, which you can find readily online. Make sure the file has the words on each line and they are all in lowercase. …

0
862
Member Avatar for Alex Edwards
Member Avatar for killdude69

This simple command line script is used to pull a prank on one of your buds. What it does is play an anoyying beeping sound over and over again while rendering the computer being used completely unresponsive. The task manager doesnt even respond. The window never loses focus and nothing …

Member Avatar for killdude69
0
137
Member Avatar for killdude69

Put the following code in a C++ Header File. The following function is to make it way more easier to draw text onto the client area of a window. Now the only thing you need to do is include the C++ Header file containing this function into any C++ Source …

Member Avatar for killdude69
0
309
Member Avatar for William Hemsworth

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.

0
745
Member Avatar for iamthwee
0
356
Member Avatar for Alex Edwards

This is a program I designed that implements a little bit of vector-math to determine the collision between 2 vectors. Hopefully this program will be useful to those out there designing 2D graphics programs and need a better solution to determining graphical object-to-object collisions when two objects meet, without having …

0
218
Member Avatar for William Hemsworth

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 …

0
170
Member Avatar for Radical Edward

One problem with C# is that if you want to modify a collection, you have to manually iterate over it. The generic List class supports ForEach, but there's no method that allows global list changes. C# is kind of restrictive in what changes you can make while iterating, so Edward …

0
210
Member Avatar for Radical Edward

Edward designed this class as a poor man's named property initializer using syntax similar to C99's designated initializers if they worked in a C++ constructor call: [code] Person me( .FirstName="Radical", .LastName="Edward", .Age=23 ); [/code]

0
268
Member Avatar for joshmo

The code prompts the user for a student name and the marks then prints out the report with a letter grade..It also asks the user for the file name and stores the data in the file.

Member Avatar for MPELANE
0
490
Member Avatar for Shalvin

Serialization is the process of saving the state of an object into persistant medium. BinaryFormatter class is used for serializing and deserializing an object. HybridDictionary is optimized for key-based item retrieval from both small and large collections.

Member Avatar for belynmoon
0
261
Member Avatar for rhoit

Just playing with the no. points used in the program: 1. Even no cannot be prime except 2 2. % division of odd by even cannot be 0

Member Avatar for muthu_tek
0
127
Member Avatar for rhoit

Just playing with the no. points used in the program: 1. Even no cannot be prime except 2 2. % division of odd by even cannot be 0

Member Avatar for WXuan
0
184
Member Avatar for zandiago

Good day, here is one of the commands that will allow you to get sound in your program. It was compiled using DevC++.

Member Avatar for t3ch|\/|4n
0
186
Member Avatar for rhoit

Nothing but the VERY HARD Work out for long day and night. It was actually i made it for my project work which my friend loved it very much. This might be the useful stuff to you also. Ya Now days rarely anyone uses the BGI stuff but also it …

Member Avatar for mukulbudania
0
194
Member Avatar for darkscript

This program generates lines of pascal's triangle, numbers after 23 generate weird output.

Member Avatar for technogeek_42
0
204
Member Avatar for darkscript

This program takes a parameter, which is how many prime numbers you need. However if you want to make a program which checks whether a number is prime or not you can delete everything in the main function and put this line instead: cout << isPrime (argv [1]) ? "It's …

Member Avatar for Dani
0
155
Member Avatar for xbretzel
Member Avatar for #include<DAN.h>

This program uses snipets from a couple of other programs that I put together in order to make a program that displays the time and date and refreshes the time and date every second. I commented practically every line to explain, as far as I know, what it does. If …

Member Avatar for stephen84s
0
170
Member Avatar for zandiago

Frequently, you may need to isolate words in a phrase. In this example, we'll use substr to carry out this task.

Member Avatar for zandiago
0
144
Member Avatar for zandiago

This is a neat little program to calculate the date of easter in any given year. The principle is based on the julian calendar.

Member Avatar for muthu_tek
0
491
Member Avatar for Duoas

First off, C++ does not know anything about the I/O device you are using. It can be a keyboard and monitor, or a file, or a network connection, or anything which can do I/O. What that means is that there is no standard way to do this in C++. That …

Member Avatar for Duoas
0
452
Member Avatar for Ancient Dragon

This is a simple example of how to delete a line from a text file. In order to do that you have to completely rewrite the file, leaving out the line(s) you want to delete. First open the input file, then open an output file (doesn't matter what filename you …

Member Avatar for majestic0110
0
11K
Member Avatar for rohit83.ken
0
114
Member Avatar for maddog39

This snippet will allow you to separate or "explode" strings into vectors via a character separator or the visa versa. In which case you would take a vector and "implode" it into a string separated by a character. Also keep in mind that this requires the libboost libraries. This was …

0
572
Member Avatar for GreenDay2001

Generates all primes till n terms. Not a wonder scripts which will generate till billions, but works pretty fine till few millions.

Member Avatar for muthu_tek
0
148
Member Avatar for Hamrick

A simple solution that prints the first n values in the fibonacci series up to the limit of an unsigned long. The program takes either command line arguments or interactive input for n and has code in place to make the program more flexible, like printing to a file.

0
157
Member Avatar for darkscript
Member Avatar for ShawnCplus
0
594
Member Avatar for darkscript

This filters out the letters and numbers in the parameters you give it.

Member Avatar for hinduengg
0
127
Member Avatar for Sturm
Member Avatar for vijayan121

a string which can be used ala std::string, preserves case, but comparisons are not case sensitive.

Member Avatar for ~s.o.s~
0
463
Member Avatar for GreenDay2001

This would let you store different things of same type into one data structure, here its a list. A good and popular example would be file and folder hierarchical structure in your computer. Perhaps this is what this code demonstrates. The code has two classes [INLINECODE]File [/INLINECODE]and [INLINECODE]Directory[/INLINECODE](derived from File). …

0
298
Member Avatar for Mpiangu

This code will create for you an application. we are goig to use visual c++ for it open visual, c++. click file then New. in the New dialogue box click projects. click win32 application. give it a name eg my_project. and click finish. Then again click file. click files. the …

0
158
Member Avatar for eXceed69
Member Avatar for eXceed69

An interactive program using std::cin, std::cout, while loop and switch which will take from user no. 0 to 9 and print the number in characters. (eg. if user inters 0 the program shall respond You Have Entered : ZERO) If any negative number is given program should terminate.

Member Avatar for Ene Uran
0
156
Member Avatar for GreenDay2001
Member Avatar for hashjoe
0
151
Member Avatar for GreenDay2001
0
132
Member Avatar for ShawnCplus

This program was inspired by my college math 1 class. It takes the values of a1, a2, b1, b2, c1, c2 and solves, displays the equation and shows the work. It also stops if the equation is dependant or inconsistent (Zero division) Cramer's Rule if a1x+b1y=c1 and a2x+b2y=c2 then x=((c1*b2)-(c2*b1))/((a1*b2)-(a2*b1)) …

0
3K
Member Avatar for vicky_dev

This program solves the geometric problem, called the Convex Hull problem. Given a set of points, the objective is to find a region such that the line joining any two points lies within that region. Informally, it is the polygon of largest area that can be formed out of the …

Member Avatar for manutd
0
577
Member Avatar for manutd
1
306

The End.