Saturday, May 22, 2010

Homework help please!!?

Given the following two text strings:





this is a short string





and





this string is not as short as the first string








write a program to perform some basic text processing.








(a) In main() you should create an array of type char for each string. Each string


will be passed to a function to be processed.


(b) Write a function that will parse a string into its individual words. This function


will print each word on a separate line and then print out the total number of


words.


(c) Don’t use any of the string functions available in the Standard C library or any


other library to perform the parsing.

Homework help please!!?
I'm not going to do your homework for you, but I'll give you a couple hints.





For part a, all you have to do is create two char array variables that contain the two strings you specified. For part b, you will need to make a loop that goes through the two character arrays looking for spaces. When you encounter a space, you should move the output to the next line, and you should increment a counter that will keep track of how many words there are.
Reply:If you are still stuck, may be you can search at homework help website like http://homeworkhelp.co.in/ .

gerbera

No comments:

Post a Comment