私はプログラミングが得意ではなく、経験もありません。これは、教師の助けがほとんどないクラスのためのものです。
タイトルは私が得ているエラーです。これは機能です:
void CapFormat (string Names, int NameCount)
 {
   int Comma;
   int c;
   int d;
    string::size_type len;
   for(c = 0; c < NameCount; c ++)
   {
     len = static_cast<unsigned> (Names[c].size);  //error starts here
     for(d = len; d > 0; d --)
     {
       tolower((Names[c].at(d)));  //supposed to lower cases every letter
     }
     touppper(Names[c].at(0));  //supposed to upper case first letter
     Comma = Names[c].find(",");  //supposed to find a comma between last and first names
     Comma = Comma + 1;
     toupper(Names[c].at(Comma));  //Error here as well.  supposed to then upper case letter after the comma.
   }
 }
エラーの拡張版は次のとおりです。
In function âvoid CapFormat(std::string, int)â:
error: request for member âsizeâ in âNames.std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((long unsigned int)c))â, which is of non-class type âcharâ
error: request for member âatâ in âNames.std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((long unsigned int)c))â, which is of non-class type âcharâ
error: request for member âatâ in âNames.std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = error: âtouppperâ was not declared in this scope
error: request for member âfindâ in âNames.std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((long unsigned int)c))â, which is of non-class type âcharâ
error: request for member âatâ in âNames.std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((long unsigned int)c))â, which is of non-class type âcharâ
Cstring、cctype、および string がすべて含まれています。私は自分の本から構文を直接コピーしました。すべてが正しいはずですが、エラーが残っています。
どうぞよろしくお願いいたします。