Heinzi1991
Erfahrenes Mitglied
Hallo liebe Community,
also ich hab ein wirklich blödes Problem mit Visual Studio. Ich hab ein kleines Übungsprogramm geschrieben, damit ich wieder ein bisschen reinkomme!
So auf meinem Laptop, der mit Linux ausgestattet ist, funktioniert das Übungsprogramm einwandfrei. So nun wollte ich es auch auf Windows (Windows 8.1) ausprobieren und hab Microsoft Visual C++ Express und da kommt so eine Fehlermeldung:
"Debug Assertion Failed!
Program: ... dio
2010\Projects\.....
File: f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c
Line: 56
Expression: (unsigned)(c+1) <= 256
For information ......"
und hier ist die Funktion die nicht so richtig will:
hoffe mir kann jemand helfen!
also ich hab ein wirklich blödes Problem mit Visual Studio. Ich hab ein kleines Übungsprogramm geschrieben, damit ich wieder ein bisschen reinkomme!
So auf meinem Laptop, der mit Linux ausgestattet ist, funktioniert das Übungsprogramm einwandfrei. So nun wollte ich es auch auf Windows (Windows 8.1) ausprobieren und hab Microsoft Visual C++ Express und da kommt so eine Fehlermeldung:
"Debug Assertion Failed!
Program: ... dio
2010\Projects\.....
File: f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c
Line: 56
Expression: (unsigned)(c+1) <= 256
For information ......"
und hier ist die Funktion die nicht so richtig will:
Code:
int woerterzaehlen()
{
int i = 0;
int wortzahl = 0;
string buffer;
string text;
string datei;
ifstream file;
cout << "Welche Datei soll das Programm einlesen? (Bitte mit Dateiendung) ";
cin >> datei;
cout << endl;
file.open(datei.c_str());
if(file)
{
while(!file.eof())
{
getline(file, buffer);
text += buffer +"\n";
}
file.close();
}
else
{
cout << "Datei leider nicht vorhanden!" << endl;
}
//ich glaub das Visual mag diesen Teil nicht//
//da einlesen der Datei noch funktioniert!//
for(size_t i = 1; i < text.size(); ++i)
{
if(isspace(text[i]) && !isspace(text[i - 1]))
{
wortzahl++;
}
}
cout << "In dieser Datei sind: " << wortzahl << " Woerter vorhanden!" << endl;
cout << endl;
return 0;
}
hoffe mir kann jemand helfen!