falsche Fehlermeldung ? C++ Builder spinnt ?



  • hier der code:

    void __fastcall TForm5::Button1Click(TObject *Sender)
    {
      RichEdit1->Text = "";
      RichEdit2->Text = "";
      std::string List;
      std::string newpath;
      int nutzlos = 0;
      int newlength = 0;
      while (nutzlos < CheckListBox1->Items->Count)
      {
    	  nutzlos++;
    	  pathplural[nutzlos] = RichEdit3->Lines->Strings[nutzlos].c_str();
      }
      for (int i = 0; i < CheckListBox1->Items->Count; i++)
      {
    	 if (CheckListBox1->Checked[i] == true)
    	 {
    	   newlength++;
    	   newpath[newlength] = pathplural[i]; // hier der Fehler
    	   RichEdit1->Text = CheckListBox1->Items->Strings[i];
    	   List+=RichEdit1->Text.c_str();
    	   List+="\n";
    	 }
      }
    

    und globaldefiniert:
    std::string pathplural[2000];

    Er sagt: [BCC32 Fehler] Playlistchange.cpp(38): E2034 Konvertierung von 'std::string' nach 'char' nicht möglich

    Das sind doch beide std::string typen 😕



  • Wo der Kompiler recht hat, da hat er recht.



  • Sehr Produktiv. Wie kommts zustande ?

    EDIT: OUPS doofer Compiler.
    newpath muss ein array sein !
    So jetzt ists richtig.


Anmelden zum Antworten