49,761 Topics

Member Avatar for
Member Avatar for mrnutty
0
330
Member Avatar for mrnutty

Random number generator under its own namespace. Its a sample program.

0
291
Member Avatar for warbird43

Link List for the beginners of cpp, who want to get the idea about link list before starting OOP. its implemented by struct for best teaching the design standards to beginners.

Member Avatar for warbird43
-1
238
Member Avatar for tux4life

This is how I would write the standard library function [B]strstr[/B] if I had to implement it from scratch.

Member Avatar for tux4life
0
569
Member Avatar for athlon32

Example of how to get a random number in the range of six and return a value based upon it. Please Rate/Comment/Report Bugs

Member Avatar for MosaicFuneral
0
131
Member Avatar for tux4life

This is a portable implementation for converting a character or an integer to its binary text equivalent. It makes use of the [B]CHAR_BIT[/B] constant (which is defined in the header file [B]climits[/B]) to get the number of bits a byte consists of on the implementation where you compile this code …

Member Avatar for MosaicFuneral
0
242
Member Avatar for tux4life

I didn't know what to do and I thought: why not try writing an interpreter, I've never done this before and it seemed quite challenging, so I started writing code.... The code which you can find below is only a simple base upon which you can start implementing your own …

Member Avatar for tux4life
0
814
Member Avatar for rhoit
Member Avatar for wavsyntax
Member Avatar for killdude69

This is the Dialogs.h part from the WGCL C++ Compiler Library I created. This creates classes for dialogs, it could cut the amount of code for dialogs you need to write in half, while still having the same amount of functionality. This library is licensed under the GNU General Public …

Member Avatar for killdude69
0
207
Member Avatar for amrith92

My implementation of the [ICODE]strcmp[/ICODE] and [ICODE]strncmp[/ICODE] functions. I don't think that it is very efficient, but have managed to get both the functions' execution times to [ICODE]0.01 s[/ICODE] (At least, this is the value my profiler gives me). Enjoy! :)

Member Avatar for amrith92
0
617
Member Avatar for tux4life

This snippet allows you to convert a text representation(*) of a [B]binary[/B] number [B]to[/B] a [B]decimal[/B] number :) (*): With 'text representation' I mean for example a string containing "1001" or "10001110011", etc. ...

Member Avatar for tux4life
0
210
Member Avatar for amrith92

These functions, to some, may seem trivial, but many people have queried in the forums on this topic numerous times. The functions are templated, so that it can accommodate any data-type that the user wishes to use (For example, the same function can be used for converting variables of type …

Member Avatar for tux4life
0
383
Member Avatar for tux4life

This is how mine [B]strcat[/B] would look like if I'd have to write it from scratch :)

Member Avatar for tux4life
0
382
Member Avatar for tux4life

This is how mine [B]strcpy[/B] would look like if I'd have to write it from scratch :)

Member Avatar for tux4life
0
204
Member Avatar for tux4life

This prime number generator is based on Eratosthenes' sieve, the found prime numbers are written to a file (you can specify it's name as a command line argument, as well you can specify the prime number upper bound (e.g: if you specify 500 as upper bound, the program will find …

0
179
Member Avatar for NicAx64

This is not the fastest way and not the one that used inside the calculators and even inside the C++ math library. But this is just another way to find logrithm of base 10.

Member Avatar for ddanbe
0
103
Member Avatar for VernonDozier

This snippet is similar to my snippets on how to create random numbers without repeats, particularly[URL="http://www.daniweb.com/code/snippet1034.html"] this one[/URL]. This snippet is different in that it takes an already existing array and "shuffles" it so that the order appears random. No checking is done to make sure that there are no …

1
769
Member Avatar for tux4life

Probably one of the poorest sorting algorithms ever written but I provide it here and anyone who wants to use it can use it in any way he/she wants :P ... Usage: `bubble_sort(your_array, number_of_elements);` int arr[] = {52,85,2,1,-56,802}; bubble_sort(arr, 6); /* order of elements in arr: {-56, 1, 2, 52, …

0
150
Member Avatar for tux4life

> I know there are some bad things in my code such as [ICODE]system("CLS");[/ICODE] and that this makes the code unportable and inefficient, but you could just remove it at anytime :) > It could be that my code is a bit bloated, I didn't put enough time and effort …

Member Avatar for tux4life
0
252
Member Avatar for William Hemsworth

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 …

0
520
Member Avatar for William Hemsworth
Member Avatar for William Hemsworth
0
726
Member Avatar for GANTOR
Member Avatar for Nick Evan
0
141
Member Avatar for MosaicFuneral

"Hello World!" done a little differently. Is this safe, unlikely; is there a point to all of this crap, nope; why are parts obfuscated, because I felt like it; was it fun, yes. You'll need the newest version of MinGW to compile, I used options -O2 -Os -s.

Member Avatar for MosaicFuneral
0
353
Member Avatar for MosaicFuneral

Got bored, remember a question asked in the forums, and decided to try something similar.

Member Avatar for MosaicFuneral
0
9K
Member Avatar for kelechi96

Hi this basicly finds and stores prime numbers at you will need to put a file called startnumber.ini with a number in it for the program to start from. Also rename the UserStorage.txt each time you use the program or it will be overwriten.

Member Avatar for William Hemsworth
0
229
Member Avatar for GreenDay2001

The given code snippet checks whether a given string is a part of other string and wildcard are allowed.

0
113
Member Avatar for tux4life

Hello, as promised I updated my stod-function from [URL="http://www.daniweb.com/code/snippet1147.html"]this[/URL] thread ... Enjoy !

Member Avatar for tux4life
0
535
Member Avatar for tux4life

Hi there, I've written a program which can add two numbers of unspecified length, isn't that nice? To add two numbers you just do the following: [ICODE]addition(number1, number2);[/ICODE], where 'number1' and 'number2' are strings ... E.g: [CODE=cplusplus] ... cout << addition("500","10") << endl; // Print '510' on the screen ... …

Member Avatar for tux4life
0
268
Member Avatar for tux4life

Hello, I've written a C++ class which 'estimates' the roots of a given number ... It was called 'sqr' because it was first intended to estimate square roots only, but later on I made some little changes to my code which made it possible to estimate every root ... So, …

Member Avatar for tux4life
0
182

The End.