49,761 Topics

Member Avatar for
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
145
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
174
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
217
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
299
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
205
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
857
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
134
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
301
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
728
Member Avatar for iamthwee
0
353
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
215
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
167
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
190
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
265
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
479
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
123
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
181
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
182
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
189
Member Avatar for darkscript

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

Member Avatar for technogeek_42
0
200
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
152
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
168
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
141
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
473
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
450
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
10K
Member Avatar for rohit83.ken
0
111
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
552

The End.