This question already has answers here:
How to convert std::string to lower case?
                                
                                    (25个答案)
                                
                        
                                4年前关闭。
            
                    
我该如何使该程序接受大写和小写ID。从文件读取时,id为大写。id的形式为S2345。请帮助。

   cout << "Enter client ID TO Change email";
   cin >> ids;

  for(int i=0; i<rec; i++)

        if(client[i].ID == ids){
            cout << "\nEnter New email\n";
            cin  >> client[i].email;

        }

最佳答案

#include <boost/algorithm/string.hpp>
#include <string>

std::string str = "Hello World";

boost::to_upper(str);

关于c++ - 如何在C++中将小写字符串转换为大写字符串,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29229555/

10-11 04:37