Announcement

Collapse
No announcement yet.

Borland C++ 3.0 Klassen Problem

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Borland C++ 3.0 Klassen Problem

    Hallo,
    ich bin noch relativ neu in cer C++ Programmierung und möchte ein MS-Dos Programm schreiben. Ja wirklich noch eine 16Bit Anwendung. Folgenden Code habe ich geschrieben um eine Datei zu öffen und den Inhalt auszugeben. .
    Code:
    #include <iostream.h>
    #include <fstream.h>
    #include <string.h>
    
    int main() {
    ifstream fin("Makefile");
    string buffer;
    
    cout << "Hier der Inhalt der Datei:\n";
    while (fin.good()) {
    getline(fin,buffer,'\n');
    cout <<buffer<<endl;
    }
    cout << "\nEnde der Ausgabe\n";
    fin.close();
    }
    Der Compiler meckert jedoch folgendes an:

    Undefined symbol 'string'
    und
    Could not find a match for 'istream::getline(ifstream, undefined, char *)'

    Hat jemand ne Idee? Ich bin mit meinem Latein am Ende ...

  • #2
    http://www.cplusplus.com/reference/i...m/getline.html
    Christian

    Comment


    • #3
      Hallo Christian,
      ist "string" nicht gleich "char_type* s" ?

      Comment


      • #4
        nein, extra Klasse der STL

        http://www.sgi.com/tech/stl/basic_string.html
        Christian

        Comment

        Working...
        X