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? 

  • 相关阅读:
    常用经典SQL语句
    怎样找到PB打包所需要的dll和pbd文件?
    C#多线程参数传递
    Sqlserver 常用日期时间函数
    SQL Server:如何判断变量或字段是否为NULL
    用c#开发可供PB调用的COM组件
    ROW_NUMBER() OVER函数的基本用法用法
    SQL Server数据导入导出工具BCP详解
    IE下 Window.Open(url,name), name参数空格、符号问题
    数据库设计系列[05]多公司加入权限系统
  • 原文地址:https://www.cnblogs.com/ecoflex/p/10177297.html
Copyright © 2011-2022 走看看