zoukankan      html  css  js  c++  java
  • c++


    char x[10]="beijing";
    char c[3][10];
    for(int i=0;i<3;i++)
    {
    cin>>c[i];
    }
    if(strcmp(x,c[1])==0)
    cout<<"equal"<<endl;


    ====================================

    char *ch;
    ch=(char*)malloc(n*sizeof(char));

     

     

    ------------------------------
    void opp(int *p)
    {
    *p=3;
    }
    void ppo(void (*opp)(int *n))
    {
    int n=7;
    opp(&n);
    cout<<n;
    }
    int main()
    {
    ppo(opp);
    return 0;
    }
    ------------------------------
    void opp(int *p)
    {
    *p=3;
    }
    void ppo()//void (*opp)(int *n))
    {
    int n=7;
    opp(&n);
    cout<<n;
    }
    int main()
    {
    ppo();
    return 0;
    }
    ------------------------------
    void ppo(void (*opp)(int *n))
    {
    int n=7;
    opp(&n);
    cout<<n;
    }
    void opp(int *p)
    {
    *p=3;
    }
    int main()
    {
    ppo(opp);
    return 0;

    ===============================


    #include<bits_stdc++.h>
    using namespace std;
    void get(char *p)
    {
    cout<<p<<endl;
    char c[]="bei";
    if(!strcmp(p,c))
    cout<<"yes";
    else
    cout<<"no";
    }
    int main ()
    {
    char c[10];
    cin>>c;
    get(c);
    return 0;
    }


    ------------------------------
    #include<bits_stdc++.h>
    using namespace std;

    int main ()
    {
    int i;
    int a[6];
    for(i=0;i<6;i++)
    {
    a[i]=(rand()%100);//(rand()%(b-a))+a //a~b区间
    cout<<a[i]<<endl;
    }
    return 0;
    }

     ==========================================

    #include<iostream>
    using namespace std;
    int main()
    {
    char c[2][10];
    char ci[8]="abcsd";
    int i=0,j=0;
    while((c[1][i++]=ci[j++])!='');
    cout<<c[1];//cout can putout chars!
    return 0;
    }

     

     

     

     

     

     

     

    }

    朝闻道
  • 相关阅读:
    关于Oracle
    form表单中包含特殊字符,需要转义。
    mysql5.7解压版安装步骤
    mysql报1055错误
    配置maven私有仓库
    全选,反选
    前后端数据交互(json)
    正则表达式匹配html标签里的中文
    excel创建行、插入行、设置样式
    Python 中文字符的输出
  • 原文地址:https://www.cnblogs.com/wander-clouds/p/8443688.html
Copyright © 2011-2022 走看看