Code Snippet A linked list with a twist
This is an example of a singly linked list allowing you to enter a number of names and associated ages. The twist is that the names are inserted into the list in ascending order. When the list is displayed, it is already sorted by name. Note: This is not an exercise in safe data input. While precautions have been taken, any fool can stress the language easily.
|+1 forum 7|
well...i tried in google...but actually i didn't quite get it. :) [url]http://www.thinkage.ca/english/gcos/expl/c/lib/fflush.html[/url] in the above link they are saying, user should definitely NOT write code of the form [CODE]printf("Prompt: "); fflush(stdout); gets(s);[/CODE] but before we used fflush after printf...for example [URL="http://www.daniweb.com/forums/post1168561.html#post1168561"]here[/URL] jephthah gave a solution where he used fflush after printf and mentioned [ICODE]// printf did not have newline, need to flush[/ICODE] When and why we need to use fflush exactly? thanks to all..
|+0 forum 8|