15,552 Topics
| |
This program outputs a given string word-wrapped to N columns in console. The program can also handle words whose length is greater than N. | |
Heres a precise and short way to permute any word without pointers | |
Break down an amount into units of dollars and cents. | |
A very versatile, fully customizable graph drawing program using the TurboC++ graphics library. The DrawGraph() functions does the actual graph drawing. It can be used to draw graphs of BOTH CARTESIAN AS WELL AS POLAR functions. You'll need to pass the math. function to the program. The main() demonstrates the … | |
Program to demonstrate pattern-searching of strings. This program interactively builds a list of words and searches for words in the list that match a specified pattern. The pattern can include wildcard chars * and ?. Eg : The query s* gives the words in the list which start with s. … | |
Powers of 2 are closly linked to the position values of binary numbers. The most right position is 2 to the power 0 = 1 then goes to the left with 2 to the power 1 = 2, 2 to the power 2 = 4 and such. If you want … | |
How might I write an implementation in C of the standard library function [inlinecode]strcat[/inlinecode]? Here's how I might. | |
This code shows you how to build a multiline story string that should display similarly to way it shows in the code. It should be relatively easy to maintain. | |
Find the maximum element in an unsorted array using recursion | |
This code enables one to find the height of a binary tree using a queue and a marker. | |
If the user tries to put 80 characters in a 20-character buffer, you may have issues. This snippet shows one way to cap the input and discard excess input. [i]See also [url=http://www.daniweb.com/code/snippet280.html]Safe Version of gets()[/url] and [url=http://www.daniweb.com/code/snippet278.html]Read a Line of Text from the User[/url].[/i] | |
This snippet shows one way to calculate the number of days since a given date until present time. Note that this code will not work for dates outside of the current epoch, which typically begins on January 1, 1970. | |
This program use a while loop to delete trailing spaces and tabs from a string. It is meant to be more of an example of the application of the while loop. | |
Commonly strings consist of ASCII characters, some are printable, some are in the backgrounds like the bell, carriage return, linefeed, tab and so forth. This code displays a table of ASCII characters and the corresponding decimal value. As always, you are encouraged to learn here. | |
Some issues, such as leading whitespace and trailing characters that cannot be part of a number, were not handled in [url=http://www.daniweb.com/code/snippet357.html]Read a Floating-Point Value from the User, Part 1[/url]. Here such issues receive lip service. [I]See also [url=http://www.daniweb.com/code/snippet597.html]Read a Floating-Point Value from the User, Part 3[/url][/I]. | |
Obtaining user input can be done in many surprisingly different ways. This code is somewhere in the middle: safer than [inlinecode]scanf("%lf", &n)[/inlinecode], but not bulletproof. It is meant to be a simple but relatively safe demonstration. Note also that there would be slight differences for using [inlinecode]float[/inlinecode] instead of [inlinecode]double[/inlinecode]. … | |
This snippet asks the user to fill in a structure and saves each record to the file. It uses append mode to add each new record to the end of the file. After all input is taken, it prints out the contents of the file. [i]Disclaimer: [font=courier new]fread[/font] and [font=courier … | |
Some issues, such as leading whitespace and trailing characters that cannot be part of a number, were not handled in [url=http://www.daniweb.com/code/showsnippet.php?codeid=266]Read an Integer from the User, Part 1[/url]. Here such issues receive lip service. | |
My first experience with pointers. Learned how to spell a string foreward and backward using pointers. I hope you can learn too! | |
This snippet shows one way to count the number of lines in a file. It will count the last line of a file even if the last line does not end in a newline. Usage: [code]C:\>linecnt linecnt.c lines = 32[/code] | |
This program was created by Gavindu Nuwan Dileepa and using this program you can add data to the stack , delete data and also you can view data from it... for more information contact [email]gavindu123@gmail.com[/email].. thanks | |
How might I write an implementation in C of the standard library function [inlinecode]strcmp[/inlinecode]? Here's how I might. [i]See also [url=http://69.93.117.133/code/snippet440.html] Strings: Comparing, Case-Insensitive[/url].[/i] | |
How might I write an implementation in C of the standard library function [inlinecode]strcpy[/inlinecode]? Here's how I might. | |
How might I write an implementation in C of the standard library function [inlinecode]strstr[/inlinecode]? Here's how I might. [url=http://www.daniweb.com/code/snippet313.html]What if I need it to be case-[b]in[/b]sensitive[/url]? | |
How might I write an implementation in C a case-insensitive version of the standard library function [inlinecode]strstr[/inlinecode]? Here's how I might. [url=http://www.daniweb.com/code/showsnippet.php?codeid=314]But I need it to be case-sensitive[/url]? | |
How might I write an implementation in C of the standard library function [inlinecode]strstr[/inlinecode]? Here's how I might. | |
This is a program I created a couple of weeks ago for class using DevC++ compiler. THis program allows the user 20 tries to guess a number between 1 and 100. It keeps track of wins and losses and offfers the option to continue or quit, displaying game stats. | |
This Program gives the details (name, kernel, machine type, domain, groups, sizeof data types, etc) of the host it is running on. | |
This Program gives the UserDetails of the logged in User. a) The RealName b) Login Name ( Why do we need this?) c) Home Directory d) Default Login Shell Additional Purpose of this code would be to invoke/ learn at man getpwuid and about struct passswd |
The End.