前提・実現したいこと
C++を勉強しています。
size(☆)と
☆.size()
の違いが知りたいです。
該当のソースコード
C++
1#include <iostream> 2using namespace std; 3int main(void){ 4 // Your code here! 5 string S; 6 cin >> S; 7 8 cout << size(S) <<endl; 9 cout << S.size() <<endl; 10} 11
試したこと
入力に
aiueo
といれたら
size(S)
も
S.size()
も5と出力されます。
違いはないのでしょうか?
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。