GithubHelp home page GithubHelp logo

cpp-primer's Introduction

C++ Primer, 5th Edition

编译和运行

  • 本项目主要是《C++ Primer(第五版)》读书笔记,以及代码范例
  • 代码按照章节进行了目录分类
  • 个人使用了Clion作为本项目的IDE,但编译和运行使用命令行的方式进行
    • 使用Clion这个IDE的时候,在 chapterXx 右键选择"Mark Directory As"中的source即可高亮文件夹了。
  • 编译命令
    g++ fileName.cpp -std=c++11
    
  • 运行
    ./a.out
    
  • 当前 macOS 版本 10.12.5 (16F73) 默认不支持 C++11 新特性,有些文件编译的时候需要加上 -std=c++11 参数才能支持C++11

expect 自动运行

  • 如果安装了expect可以直接执行每个章节下的run.sh文件,来批量执行每个程序查看运行效果,
  • 要注意脚本文件具有执行权限,没有权限时需要进行赋权:
    chmod +x chapterXx.sh
    chmod +x run.sh
    
  • 因为expect用的不是bash所以 sh run.sh 会报错,执行的时候直接 ./run.sh 就可以了。~切记!

其他

参考

文件命名方式

  • 1.1.0_introduction.cpp 一般文件命名
  • 1.5.1_d01_read_write.cpp 一节多个范例
  • 1.5.1_P_120.cpp 课后习题

cpp-primer's People

Contributors

adolphor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.