Modern C++ Course [Lecture 0] {Course Introduction and Hello World} & [Lecture 1] {Variables, Basic ...

本课程介绍现代C++在计算机视觉和图像处理领域的使用,包括讲座视频、幻灯片和作业分配。课程覆盖变量、基本类型、控制结构等主题,并推荐使用Clang编译器。此外,详细讲解了C++11的新特性如auto,以及向量的高效使用技巧。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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? 

 

转载于:https://www.cnblogs.com/ecoflex/p/10177297.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值