-1
私は、以下の詳細なエラーによってかなり混乱して取得しています:次のようにヘッダファイルがあることをC++のXcode 9.0
#include "width.hpp"
#include <vector>
#include <string>
using std::string; using std::vector;
using std::max;
//Expected function body after function declarator error message here
string::size_type width(const vector<string>& v)
{
string::size_type maxlen = 0;
for (vector<string>::size_type i = 0; i != v.size(); ++i)
{
maxlen = max(maxlen, v[i].size());
}
return maxlen;
}
:
#ifndef GUARD_width_hpp
#define GUARD_width_hpp
#include <vector>
#include <string>
std::string::size_type width(const std::vector<std::string>&)
#endif /* width_hpp */
ことができる誰か私にいくつかの援助を提供しますか?
乾杯!
*すべての関連コード(および*関連するコードのみ)を*テキスト*として含めるように質問してください。あなたの場合、これは 'width.hpp'の内容も意味します。 – Angew