惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
IT之家
IT之家
C
Check Point Blog
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
美团技术团队
M
MIT News - Artificial intelligence
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
F
Fortinet All Blogs
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
爱范儿
爱范儿
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)

博客园 - ->

[Under the hood]---Matt Pietrek October 1996 MSJ [under the hood]Reduce EXE and DLL Size with LIBCTINY.LIB TN035: Using Multiple Resource Files and Header Files with Visual C++ [转]IOCP介绍 A simple IOCP Server/Client Class Flash for Linux CodeProject站点地图 MFC Macros and Globals (搜集)一些少走弯路的话语+参考信息 [总结]软件工程师笔试题目(C++) [转贴][VC++6.0] 一个很深的模板Bug [转贴]35岁之前成功12条法则 C++/STL/VC资源链接(查找方便) [转贴]The Code Project Visual C++ Forum FAQ 看看你是否需要更新SYMBOL文件了?? 世界上有很多的"绳"模型 [转贴]VC:__declspec(novtable) [转贴]五个寓言故事令你受益匪浅 为什么用户自定义消息通常+0x400
The quick brown fox jumps over the lazy dog.
-> · 2012-09-03 · via 博客园 - ->

一只敏捷的棕色狐狸跳到了一只懒狗身上。

据说该句是包含所有26个字母的最短的句子。

1句9词26字-----------微软MSDN中常用来做各种字符串比较操作的例子。

MSDN2001

Example

/* STRCMP.C */

#include <string.h>
#include <stdio.h>

char string1[] = "The quick brown dog jumps over the lazy fox";
char string2[] = "The QUICK brown dog jumps over the lazy fox";

void main( void )
{
    char tmp[20];
    int result;
    /* Case sensitive */
    printf( "Compare strings:\n\t%s\n\t%s\n\n", string1, string2 );
    result = strcmp( string1, string2 );
    if( result > 0 )
        strcpy( tmp, "greater than" );
    else if( result < 0 )
        strcpy( tmp, "less than" );
    else
        strcpy( tmp, "equal to" );
    printf( "\tstrcmp:   String 1 is %s string 2\n", tmp );
    /* Case insensitive */
    result = _stricmp( string1, string2 );
    if( result > 0 )
        strcpy( tmp, "greater than" );
    else if( result < 0 )
        strcpy( tmp, "less than" );
    else
        strcpy( tmp, "equal to" );
    printf( "\t_stricmp:  String 1 is %s string 2\n", tmp );
}

Output

Compare strings:

The quick brown dog jumps over the lazy fox

The QUICK brown dog jumps over the lazy fox

strcmp:   String 1 is greater than string 2

_stricmp:  String 1 is equal to string 2

//demo.cpp

#include<iostream>
using namespace std;

int main()
{
                //01234567890123456789012345678901234567890123==45
    char slang[]="The quick brown fox jumps over the lazy dog.";

    cout<<"sizeof(slang)=="<<sizeof(slang)<<endl;

    cin.get();

    return 0;
}