#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> vec({1, 2, 3});
for (int i: vec)
cout << i << ' ';
return 0;
}
-參考
#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;
}
C:\opencv\build\include;
C:\opencv\build\x64\vc15\lib
opencv_world460.lib