编写函数get_max,其功能是将字符串s中最大字符的地址返回,不知出错在哪

编写函数get_max,其功能是将字符串s中最大字符的地址返回,再编写一个主函数,调用该函数,将字符串s中从最大字符开始的子串中小写字母转换成大写字母,然后输出新字符串s。例如,假设s的内容为“qwertyou”,则从最大字符’y’开始的子串为“you”,处理后的s为“qwertYOU”

这是c++的基础题,但是我不知道代码哪里出了问题,想要问问大家


#include 
using namespace std;

char* get_max(char s[]){
    int i=0,imax=0;
   while(s[i]!='\t'){
   if(s[imax]return s+imax;
  }
int main()
{
   char s[100];
   int i;
   gets(s);
   char *p=s;
   char *m;
   m=get_max(s);
  for (int i = 0; i < strlen(s); i++)
    { 
        if (p>=m)
            *p=*p+ 'A' - 'a';  
        *p++;
    }
   cout<system("pause");
    return 0 ;
}

get_max函数中 while(s[i]!='\t') 改成 while(s[i]!='\0'),字符串结束符是 '\0',不是 '\t'