Skip to content

Latest commit

 

History

History
88 lines (67 loc) · 1.27 KB

vector.md

File metadata and controls

88 lines (67 loc) · 1.27 KB

vector 走訪

#include <iostream>
#include <vector>

using namespace std;
int main()
{
    vector<int> vec({1, 2, 3});
    for (int i: vec)
        cout << i << ' ';
    return 0;
}

-參考

namespace

#include <iostream>
using namespace std;
namespace demo{
    class Demo {
    public:
        int a;
        int b;
        
        int do_something() {
            return a + b;
        }
    };
}

int main() {
    demo::Demo d;
    d.a = 55;
    d.b = 66;
    cout << d.do_something() << std::endl;
    
    return 0;
}

標頭檔設定

  • test.h
#include <iostream>

using namespace std;

void call(){
    cout << "my test!" << endl;
}
  • main.c
#include <iostream>
#include "test.h"

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    call();
    return 0;
}

OpenCV 設定

C:\opencv\build\include;

C:\opencv\build\x64\vc15\lib

opencv_world460.lib

Reference