Guest_imported
New member
- Jan 1, 1970
- 0
mgayan (Visitor) Jul 13, 2001
Write a function (ReOrderWord(const char *string )) using a subset of C (see "Restrictions" bellow" to rewrite string "TODAY IS A BEST BOSTON DAY" as "DAY BOSTON BEST A IS TODAY".
Restrictions:
You do NOT have access to string libraries and CANNOT use functions like Stringtok(), strcmp(), etc. Only basic C instructions are allowed (we want to see at how you handle pointers...)
You CAN use any function giving the length (strlen()) or size of a string and functions to copy all or part of a string. You CAN create any additional array, string, list, etc, you think you need to solve the problem.
The function must work with any string containing any number of letters..
----------
Note 1: the input is a nul terminated String. Do NOT use anything else (like a list of the words already tokenized!).
----------
Write a function (ReOrderWord(const char *string )) using a subset of C (see "Restrictions" bellow" to rewrite string "TODAY IS A BEST BOSTON DAY" as "DAY BOSTON BEST A IS TODAY".
Restrictions:
You do NOT have access to string libraries and CANNOT use functions like Stringtok(), strcmp(), etc. Only basic C instructions are allowed (we want to see at how you handle pointers...)
You CAN use any function giving the length (strlen()) or size of a string and functions to copy all or part of a string. You CAN create any additional array, string, list, etc, you think you need to solve the problem.
The function must work with any string containing any number of letters..
----------
Note 1: the input is a nul terminated String. Do NOT use anything else (like a list of the words already tokenized!).
----------