Well we have already discussed about the usage of ‘fflush’ statement, let us now discuss about the usage of ‘gets’ statement. String is an array of characters and we use the format specifier ‘%s’ to directly get these array of characters, which is not possible in the case of array of integers. In the case of array of integers we use the ‘for’ loop to get the values since we don't have any format specifier for array of integers.
To get array of characters we use the format specifier ‘%s’ as shown below
puts(“Enter the string”);
scanf(“%s”,ex_str);
puts(ex_str);
Enter a string
sample text
sample
puts(“Enter a string”);
gets(ex_str);
puts(ex_str);
Enter a string
sample text
sample text
Just think of getting a name of a person which contains first name, last name and middle name so this ‘gets’ statement is much useful in those situations. Happy Programming!!


















7 comments:
hello... hapi blogging... have a nice day! just visiting here....
hi... just dropping by!
http://www.fileafro.com
http://mobileandetc.blogspot.com
http://kantahanan.blogspot.com
Rare Seiko is biggest watches old seiko watches industry. Made the first self-winding wristwatch vintage 1970's watches.Seiko timepieces are
designed to be water resistant.Collections Elite Collections Tressia and La Grand Sport, which includes the
Arctura ,Sportura and Coutura. Most selling items are Kinetic Perpetual, Kinetic Chronograph, Kinetic Auto Relay, Kinetic, Analog Digital,Chronograph, Flight Computer and Perpetual Calendar
For more information on quality luxury watches
The Mya is a truly remarkable Hookah that encompasses detail with its ornate design and unique vase. The stem may be disassembled for storage and easy cleaning. The Mya Hookah is stored in a hard style carrying case that contains a security combination code for comfort and privacy.
http://www.maharajahookah.com/mya-hookah/cat_22.html
http://www.maharajahookah.com/mya-hookah/new-mya-hookah-shisha-tall-hookah/prod_462.html
Mya Hookah
Blue Tall Mya Hookah Shisha
hi.. just dropping by here... have a nice day! http://kantahanan.blogspot.com/
Post a Comment