搜索
查看: 247|回复: 0
打印 上一主题 下一主题

显示“P”: 未声明的标识符,是头文件找不到吗?

[复制链接]
跳转到指定楼层
楼主
 楼主| 发表于 2020-11-18 15:11:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
5啊哈币
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cctype>

  4. using namespace std;

  5. int main()
  6. {
  7.     char* p;
  8.    
  9.     char str[80]="This is a Test";
  10.    
  11.     cout<<"Original string:"<<str<<'';
  12.    
  13.     p=str;
  14.    
  15.     while(*p){
  16.         
  17.         if(isupper(*p))
  18.             *p=tolower(*p);
  19.         else if(islower(*p))
  20.             *p=toupper(*p);
  21.             
  22.         P++;   
  23.                  
  24.     }
  25.    
  26.     cout<<"Inverted-case string:"<<str<<endl;
  27.    
  28.     return 0;
  29. }



复制代码

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表