zoukankan      html  css  js  c++  java
  • string类的常用功能演示

    这个程序可用随着我对string的用法的增多而有调整。

    /*
    功能说明:
    	string类的常用功能演示。
    实现方式:
    	主要是演示string的常用函数的用法和它与字符数组的区别与联系
    限制条件或者存在的问题:
    	无
    */
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    int main(int argc, char **argv)
    {
    	cout << "process begin at " << (void*)&main << endl;
    
    	//string对象和字符数组的比较。说明string对象可以直接和字符数组的内容进行比较。
    	string str = "hello;1";
    	cout << "string is " << str << endl;
    
    	if (str == "hello;1")
    	{
    		cout << "str == hello;1" << endl;
    	}
    	else
    	{
    		cout << "str != hello.1" << endl;
    	}
    
    	return 0;
    }
    

     程序结果:

    process begin at 0087152D
    string is hello;1
    str == hello;1

  • 相关阅读:
    βVAE学习
    条件GAN学习
    epoll的事件的状态
    RST报文产生的情况
    SIGPIPE信号产生原因
    methods事件
    for列表渲染
    if条件渲染
    data数据
    vue的简单上手
  • 原文地址:https://www.cnblogs.com/babyha/p/6443761.html
Copyright © 2011-2022 走看看