zoukankan      html  css  js  c++  java
  • Modern C++ Course [Lecture 0] {Course Introduction and Hello World} & [Lecture 1] {Variables, Basic Types, Control Structures}

    http://www.ipb.uni-bonn.de/teaching/modern-cpp/

    Introduction: This page contains all the information on the course Modern C++ for Computer Vision and Image Processing including all lecture videos (also available on YouTube), lecture slides, and the homework assignments.


    2018/12/25

    Lecture_0: Course Introduction and Hello World

     https://google.github.io/styleguide/cppguide.html

     

     

    Microsoft Visual c++ compiler is exclusive in Windows.

    Here we prefer Clang, because Clang has better error explanation.


    Lecture_1: Variables, Basic Types, Control Structures 

      

     

    Google naming rules: https://google.github.io/styleguide/cppguide.html#General_Naming_Rules 

     

    auto is a new and reliable feature in c++ 11.

    [Advanced] If curious read detailed info here: http://en.cppreference.com/w/cpp/language/types 

    float numbers are imprecise, so dont do "==" operation.

    eg. (float) ??? == 2 turns into false, because ??? = 1.99999999999

     

     

     

    No project has no Vector!

     emplace_back is computationally expensive, because of the resizing.

    Use a reserve(n) to accelerate the program if you know roughly how many items are going to be.

    #include <iostream>
    #include <vector>
    #include <string>
    
    using namespace std;
    
    int main(){
    
        vector<int> int_vec = {1,2};
        cout << int_vec.front() << " " << int_vec.back() << endl;
        int_vec.emplace_back(3);
        cout << int_vec[0] << " " << int_vec[int_vec.size()-1] << endl;
    
        vector<string> str_vec = {"hello","world"};
        cout << str_vec.front() << " " << str_vec.back() << endl;
    
        return 0;
    }
    

      

    show all the warnings.

     

     

     

     

     we prefer "if" to "while"

     

    three steps:

    add - commit - push 

     References

    Cpp Core Guidelines: https://github.com/isocpp/CppCoreGuidelines

    Google Code Styleguide: https://google.github.io/styleguide/cppguide.html // kind of goes into depth

    Git guide: http://rogerdudler.github.io/git-guide/

    C++ Tutorial: http://www.cplusplus.com/doc/tutorial/

    Book: Code Complete 2 by Steve McConnell // if you feel programming is what you like, this is a book you must read in your career. And why not doing it kind of now? 

  • 相关阅读:
    OSI参考模型(转)
    H3C交换机配置常用命令(转)
    H3C交换机配置学习随笔
    [Swust OJ 247]--皇帝的新衣(组合数+Lucas定理)
    [Swust OJ 1084]--Mzx0821月赛系列之情书(双线程dp)
    [Swust OJ 404]--最小代价树(动态规划)
    [Swust OJ 610]--吉祥数
    [Swust OJ 137]--波浪数(hash+波浪数构造)
    [Swust OJ 566]--开N方数(牛顿切线法解高次方程)
    [Swust OJ 1125]--又见GCD(数论,素数表存贮因子)
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10177297.html
Copyright © 2011-2022 走看看