Giter Club home page Giter Club logo

cppp-c's Introduction

C++ Plus C Language library

cppp-c's People

Contributors

chenpi11 avatar

Watchers

 avatar

cppp-c's Issues

如何实现C++ Plus C 的c_string?

C++ Plus C 的string要实现兼顾兼容性和空间

C++ Plus C 的c_string是一种特殊的结构,可以自动选择编码形式
1.当内容只有ASCII字符的时候,编码为ASCII(utf-8)(char*)
2.当内容出现非ASCII字符(如中文)的时候,编码为Unicode(WCHAR_T)(c_wchar*)
3.当内容出现UCS-16字符(如emoji)时,编码为UCS-16(char16_t)(UCS-16) (这条可以不做)
注:在某些GNUC环境下,wchar_t被设置为int,相当于char16_t,但这是不兼容C++标准的,C++中一个wchar_t等同于unsigned short的长度,这里定义了c_wchar类型表示unsigned short

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.