Red Star Over China

细节决定成败?理论联系实际,实践是检验真理的唯一标准,学着学着就逐渐熟悉了,不积硅步无以至千里!

#include <iostream>
#include <stdio.h>
#include "extra.h"
int main()
{
    std::cout << "Hello World!\n";
    //have this operation, give six
    printf("%d\n", bufferSize);
    //const
    double dval = 3.14;
    const int& ri = dval;
    std::cout << ri << std::endl;
    //reference
    int i = 42;
    int& r1 = i;
    r1 = 0;
    std::cout << i << std::endl;

    //end
    const int valu = 10;
    int vo = 20;
    const int* p;
    const int* const p2 = &valu;
    int* const p3 = &vo; 

    //constexpr
    constexpr int* np = nullptr;
    int j = 0;
    //*np = j;
    //std::cout << *np << std::endl;
    int null = 0, * pp = &null;

    //ref
    const int& hg = 42;

    //decltype's special
    int a = 3, b = 4;
    decltype(a) c = a;
    decltype((b)) d = a;
    c++;
    d++;
    //result should be a = 4,b = 4,c = 4,d = 4;
    std::cout << std::endl;
    std::cout << "a:" << a << "b:" << b << "c:" << c << "d:" << d;
    return 0;
}

在不断的实践中补足自己的短处,问题越积累越多,但是,解决问题并积累,Advantages就会愈多,真理!

0.9999^365
1.0001^365

差异很大!

clear all
close all
clc
% LearningMethod
error = 0.9999^(365*10);
right = 1.0001^(365*10);
disp(error);
disp(right);

Red Star Over China

发表评论

电子邮件地址不会被公开。 必填项已用*标注