Пример #1
0
void main(){
  char val[256];
  printf("Enter a string: \n");
  fgets(val, 256, stdin);
  /* First implementation */  
  string_reverse1(val);
  /* Second implementation */
  printf("2nd implementation - Reversed string: %s\n\n", string_reverse2(val)); 
  system("pause"); 
}  
int main() {

	// Testing 1st Reverse Method (Inplace Reverse Method)
	char str1 [] = "Hello1";
	string_reverse1(str1);
	printf("%s\n" , str1);

	// Testing 2nd Reverse Method (Copy Reverse Method)
	char str2 [] = "Hello2";
	char * res = string_reverse2(str2);
	printf("%s\n" , res);
	return 0;
}