19,876 Topics
![]() | |
Hello, as promised I updated my stod-function from [URL="http://www.daniweb.com/code/snippet1147.html"]this[/URL] thread ... Enjoy ! | |
Hello there, I've written a C++ function 'stod', which converts a C++ string to a double ... You're free to use this code for EVERYTHING you want ... There's only one thing which I'm not appreciating: [B][COLOR="Red"]It's not allowed to sell this source code to anyone ![/COLOR][/B] The usage is … | |
Here's some rudimentary code that does directory traversal recursively. Useful for inspecting the contents of a directory subtree. Sorting the directory information or inspecting file details within directories is beyond the scope of this routine. | |
This code snipplet will find the placement of each letter in a array(string), from another array(character set). For example: the input would be something like this: string[256] = "gfdc" chrset[256] = "abcdefg" and the output would be: num[256] = 6, 5, 2 and 3 | |
Hello friends here i present a simple address diary program that store name, phone number,sunsigh,best moment date of birth and place,and also hobby of a person.... When you run this u must fill password and password is "hello"... I think you will enjoy it.............. | |
Hello friends, I am new participant in daniweb Here is the fantastic coding of SHEEL SORT.. | |
Here are 2 pieces of code. The first makes a hidden partition accessible by creating a path to it and assigning a drive letter. The second removes the path definition, effectively rehiding the partition. It is advised that caution be taken in the use of this code. The core to … | |
Here is a binary search program quite simplified | |
It includes Binay tree construction,Inorder,preorder,postorder traversals | |
This program displays all possible permutations of the string entered. say if u enter "abc" as input string the possible permutations would be displayed as ......................... abc acb bca bac cab cba .......................... | |
This a routine that executes a _popen() pipe on your behalf and retrieves the spawned program's/comand's console output for you. Useful if your program needs data from another program and can't communicate directly with it. | |
Program is of the calculator which the usual thing for the operation. It has been totally implemented in the C language with the graphics and mouse functions included in it. Its not scientific but just a usual one.. | |
A program that demonstrates opening Windows registry keys, reading data fields and closing the keys. | |
Two very short routines. CLIPPUT transfers data to the clipboard and CLIPGET retrieves data from the clipboard. Developed and tested in Windows XP using a Borland C++ compiler. | |
Iterative and recursive programs.these programs have been tested and run very well.enjoy | |
![]() | Hi from Begueradj, This program written in Turbo C simulates a student data bases using files. Basic operations such as seeking for a given student, deleting, adding and sorting are implemented here. Feel free to give me your points of view. Thanks, Begueradj. ![]() |
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. | |
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 … | |
You likely want something graphical, where the things move. GTK version of the classic arcade game Asteroids. | |
A small demo about how to use GTK label as a simple console. To compile GTK program, `pkg-config gtk+-2.0 --cflags --libs` should finally be somewhere in the compiler command line in the bash-like shell. | |
Replaces every occasion of the pattern, or only the first occasion if there is a subexpression, between \( and \), anywhere in the regular expression, as repeated replace is not what one would expect in that case. The string size is restricted in POSIX regular expressions to the size of … | |
THE program highlights how to create a 2d array in freestore using pointers.. this is my first post so if i commit any fallacies regarding protocol or syntax please forgive me .... | |
choose a random element from a sequence when a. you do not know how many elements are there before hand b. you want to make one single pass through the sequence c. you do not want to use auxiliary storage | |
hi every body try out this code it can store your info and then retriaeve it ant any time you wish. They are two codes each wrote separatly so first write the outputting code and run it. Then write the inputting code and also run it have fun:lol: | |
Here is just a simple program to sort two strings inputted from the user entered on the command line. | |
For all functions, a domain error occurs if an input argument is outside the domain over which the mathematical function is defined. On a domain error, the function returns an implementation-defined value. | |
This snippet uses [INLINECODE]strtod[/INLINECODE] to be a little more stringent. | |
This code snippet actually contains a few nifty things. There are two functions, hasVisited() and main(). hasVisited() makes use of a very handy function for CGI programmers: getenv. You can see I use it to retrieve REMOTE_ADDR which is the person's IP address. In main() it gets the count from … | |
The program uses doubly linked lists to store the numbers where each node contains a single digit . Hence numbers of any length can be used as operands . Program works only with +ve integers | |
the code now contains snippet to create the linked list too! any questions can be directed to [U]raghu_tillu@hotmail.com[/U] | |
Hello to everyone out there. Recently many people on different forums have been asking how to make a recursive function which reverses the string passed to it. But unlike the normal recrusive funtion which only prints out the reversed string, this implementation returns a pointer to reversed string. | |
The program parses the digits in the number supplied to it and converts it to aplhabetical equivalent. Fore eg. input: 1234 output: one two three four This is a simple exercise for newbies, must try out. Tested and works under ideal input conditions. | |
Just a short little C program to send beeps to the PC internal speaker. Beep(frequency_hrz, duration_ms) is a WinAPI function as is Sleep(ms). | |
This algorithm proved to be effective when two images are combined. The picture beneath (background) is seen if alpha component of fronth picture is less then 0xFF. If alpha of front picture (src in snippet) is zero then all we see is background picture. The format of colour is ARGB … | |
A simple program to calculate combinations of a string using recursion, I have used a malloc string of size 100 , you can change it to whatever value you want. The author is currently working at Microsoft. for eg if input string is abcd and you want all 3 letter … | |
This snippet is an example of using XOR encryption to encrypt/decrypt a file. It uses command-line input parameters as follows:[indent]argv[1] - name of input file to encrypt/decrypt argv[2] - name of output file argv[3] - crypt key[/indent]For example, an input file called "main.c" is used to create an output file … | |
In [url=http://www.daniweb.com/code/snippet259.html]Part 1[/url], the code reversed the string in place. This version uses a source and a destination string. | |
/*This program works just like MS-DOS. It takes in the input, uses the C Library, uses the system files and function, executing and displaying the code on the same command prompt. */ | |
This snippet shows how to use command line arguments as variables in your program. A command line argument is extra information you give a program at runtime, by typing the information after the program name like so: Linux might look like this: user$: ./myprogram argument1 argument2 A windows command prompt … | |
Used recursion to reverse the string. Another method for string reversal. | |
Returns the duplicate value in array t[n], which contains numbers 1 to n-1. Given two approaches with O(n) and O(n-square) complexities. | |
Return Nth the node from the end of the linked list. Time Complexity is O(n). | |
One line stament which acts as a conditional operator ?: If x=true, returns y else returns z. | |
[B][COLOR="Red"]Introduction[/COLOR][/B] There are many times when we try to create a binary search tree of many different data types. This article explains creation of a template library CTree. template <class T>class CTree can be used to create a binary search tree (BST) of any data type. [B][COLOR="red"]Features[/COLOR][/B] This class support … | |
Beginner C++ - A simple calculator writen in C++, compiled on Tubo C++ v4.5 & Borland C++ 5.5. The user inputs numbers & chooses '+','-','*'/' The operator is tested. If correct the appropriate sum is preformed. | |
This program calculates the determinant of a square matrix of any order using a recursive function. Uses a square matrix struct and related functions. | |
count the number of occurrences of a sub-string in another string. a good example for learning how to make your own functions like strcpy, strlen and strcmp |
The End.