1,076,254 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by phani1092 Contributing to Articles being Marked Solved

Segmentation fault is displayed as error message when you are trying to insert at more than the memory you allocated.

you've declared temp array and it is occupying 50 bytes(depends on the configuration of the system) of memory. So if you are trying to store at the 51st or more location of tmp array it is diplayed as segmentation fault. Try changing the tmp array to 100 or more than that.You may get the desired output.

phani1092
Newbie Poster
19 posts since Oct 2010
Reputation Points: 10
Solved Threads: 3
Skill Endorsements: 0

Dude, reading a string by length would be much easier. The steps goes this way

  1. Read the length of each word. For every word there will be space compare the string with the space if space found store the word in an array.
  2. Now the words are ready placed in arrays. Read each length of array.
  3. Compare each array length.
  4. Sort them according to increasing or decreasing order.
  5. Print the values of last three or first three depending on the order you give.
phani1092
Newbie Poster
19 posts since Oct 2010
Reputation Points: 10
Solved Threads: 3
Skill Endorsements: 0

Try to declare a float variable; assign the (1/n) value to the float variable and print the
value.

phani1092
Newbie Poster
19 posts since Oct 2010
Reputation Points: 10
Solved Threads: 3
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.0423 seconds using 2.46MB