• _strupr _wcsupr _mbsupr


    将字符串转化为大写的形式(Convert a string to uppercase.)
    定义:

    char *_strupr( char *string );

    wchar_t *_wcsupr( wchar_t *string );

    unsigned char *_mbsupr( unsigned char *string );

    注意事项:

    函数自动将传入的字符变为大写的形式,返回指针和string是一样的,因此可以不使用返回值

    These functions return a pointer to the altered string. Because the modification is done in place, the pointer returned is the same as the pointer passed as the input argument. No return value is reserved to indicate an error.

    举例说明:这里使用安全函数

    void main()
    
    {
    
       char string[100] = "The String to End All Strings!";
       char *copy1, *copy2;
     
    
       copy1 =  _strupr(string);//copy1 与string的地址相同,此时字符串都转化为大写
       copy2 = _strlwr(string);//copy2 与copy1 还有string的地址相同,此时字符串都转化为小写
    
    
    
       _strupr_s(string);  //使用安全函数又转化为大写,不需要返回值了,以后编程中推荐使用
    
    }
    
  • 相关阅读:
    全局配置策略
    RESTful api介绍
    AJAX
    django cookie session 自定义分页
    mysql 索引优化
    yii2 response响应配置
    Django中的信号
    django orm相关操作
    django orm介绍以及字段和参数
    django form和ModelForm组件
  • 原文地址:https://www.cnblogs.com/priarieNew/p/9754479.html
Copyright © 2020-2023  润新知