const1.cpp

来自「VC源代码大全(精华版)」· C++ 代码 · 共 22 行

CPP
22
字号
#include    <stdio.h>
#include    <iostream.h>
#include    <string.h>
#define   NETWORK   "A network can be loosely defined "\
                    "as the hardware and software that "\
                    "allow two entities to communicate.";
#define   NETWORK   "A network can be loosely defined "\
                    "as the hardware and software that "\
                    "allow two entities to communicate.";
char *str1 = NETWORK;
char *str2 = NETWORK;

int main ()
{
    char *s = strstr (str1, " two");
    if (s != NULL)
        strcpy (s, " 2 entities to communicate");
    cout << str1 << endl;
    cout << str2 << endl;
    return (0);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?