By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,946 Members | 1,298 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,946 IT Pros & Developers. It's quick & easy.

sorting of strings using C?

P: 1
how can we sort the string eg: "My Name is komal" how can we sort it as per word?
Nov 19 '08 #1
Share this Question
Share on Google+
2 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
Create an array of strings.
Extract each word from "My Name is komal" and place it in the array.
Sort the array.
Nov 19 '08 #2

gpraghuram
Expert 100+
P: 1,275
You can use qsort which is available with stdlib.h to sort the array(Which u create by breaking the sentence and pushing the same to array)

Raghu
Nov 20 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.