.size() 與 .length() 的返回值是無符號數。
#include <iostream>
using namespace std;
int main() {
string a = "";
cout << a.size() << ' ' << a.length() << endl;
cout << a.size() - 1 << ' ' << a.length() - 1 << endl;
return 0;
}
輸出:
.size() 與 .length() 的返回值是無符號數。
#include <iostream>
using namespace std;
int main() {
string a = "";
cout << a.size() << ' ' << a.length() << endl;
cout << a.size() - 1 << ' ' << a.length() - 1 << endl;
return 0;
}
輸出:
vuex中mutation和action的詳細區別 const store = new Vuex.Store({ state: { count: 0 }, mutations: { increm