In this Program pointer concept is been used with the use of variables of pointer type char and integer type which contain the values. Reorder () also used for sorting the the string as required. In the program string is to be entered after that loop statement works. During loop statement the pointer type variable acquires the memory using malloc() function.
The next move is to sort the string here loop statement again come in use and then printing the string. So on the next step string functions comes into the frame like Strcmp() or Strcpy() for conditionally checks the string. Here while using the string function if condition also comes into the place for checking if the string sorted or not in the last the sorted string is to be displayed as output.
Here we have to make a Program to sort the String with using Pointer and string Functions.
- Entering the String.
- Using required functions.
- Using loop Statement.
- And Display The Output on the Screen.
The C program is successfully compiled. The program output is also shown below.
void reorder(int n,char *x);
printf("Enter no. of String : ");
printf("Enter the Strings %d : ",i+1);
printf("\nreorder list is : \n");
void reorder(int n,char *x)