int main()
{
std::string SPEACH;
std::string WOrt;
std::string KUNDE;
std::string KUNDEN;
std::string WORDS;
std::string ENTRE;
std::string DEFINITION;
std::string ALLES;
std::string NOMEN;
{
cout << "\n Whats your name? \n";
set<string> KUNDE;
{ ifstream in("Kunden.h");
for(string wort; in >> wort;)
KUNDE.insert(wort);
}
{ for(string wort; cin >> wort;)
if (KUNDE.count(wort))
goto NEXT4;
elsegoto NEXT4;
}
}
{NEXT4:
cout << "I don't know you. Where do you life? \n";
fstream datei6;
datei6.open("speach.h", ios::app);
cin >>SPEACH;
{ set<string> namen;
{ cout << "Gib deinen Namen ein";
ifstream in("Kunden.h");
for(string wort; in >> wort;)
namen.insert(wort);
}
{ for(string wort; cin >> wort;)
if (namen.count(wort))
goto NEXT2;
else
{ cout << "I don't know the wort " << wort << " Is it a Nomen or a Name?";
cin >> WORDS;
{fstream datei1;
fstream datei2;
if (WORDS == "Nomen")
{ { datei1.open("Nomen1.h", ios::app);
datei2.open("Nomen2.h", ios::app);
{ cout << "Wie lautet der Singular?" << endl;
cin >> ENTRE;
datei1 <<"\n" << ENTRE << endl; }
}
{ cout << "Bitte definieren Sie den Begriff mit einem Wort" << endl;
cin >> DEFINITION;
datei2 << DEFINITION << endl; }
}
elseif (WORDS == "Name")
{ datei1.open("Name.h1", ios::app);
{ cout << "Wer ist das?" << endl;
cin >> ENTRE;
datei1 <<"\n" << ENTRE << "\n " << endl; } }
datei1 << ENTRE << endl;
datei2 << ENTRE << endl;
} } } }
{ NEXT2:
cout << "."; }} }
I can save definitions or names, but I can't access DEFINITION or NAMEN/Nomen! What I want:
Entre a word, it checks if it's still there.
If not, it will save the word and it's definition.
I need:
If I entre a word, the PC must entre me the other word back.
Es sieht aus wie Sie die Variable "wort" eine Menge zu verwenden, aber man erklärte es als "WOrt". Sie dürfen keine Daten bekommen, weil der variable Name stimmt nicht überein.
Sie haben zu viele Klammern. Ich habe versucht, den Code zu bereinigen, aber ich weiß nicht, ob dies zu tun, was Sie wollen. Probieren Sie es aus, und wenn es nicht klappt, werde ich helfen, etwas mehr.
Thanks.
But it doesn't help my mainproblem:
I can save definitions or names, but I can't access DEFINITION or NAMEN/Nomen! What I want:
Entre a word, it checks if it's still there.
If not, it will save the word and it's definition.
I need:
If I entre a word, the PC must entre me the other word back.
ich kann zwar abspeichern, doch nicht auf die DEFINITION oder NAMEN/Nomen zurückgreifen! Also kann ich, wenn ich einen NAMEN/NOMEN eingebe keine DEFINITION kriegen, und wenn ich die DEFINITION eingebe, keinen NAMEN/NOMEN kriegen.
Was ich möchte:
Gebe Wort/Satz ein, es wird geprüft ob es vorhanden UND definiert ist.
Falls nicht, muss es getan werden.
Wenn ich dann ein Wort eingebe und es da ist, möchte ich dessen Definition ausgegeben kriegen.
Ich kann Ihnen dabei helfen, aber zuerst müssen Sie bestätigen, dass alle Ihre Aussagen an der richtigen Stelle sind. Ich könnte zusätzlichen Code in Schleifen gelegt haben, wo sie nicht hingehören, oder genommen Code heraus.
Sobald das getan ist, kann hier jemand helfen Ihnen bei der Lösung Ihrer Probleme Code.
I found the best way. My last question:
I have this: #include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
int
main()
{
ifstream fin("example.txt");
string line;
while (getline(fin, line)) {
istringstream tokenizer(line);
string token;
getline(tokenizer, token, ',');
cout << token << endl;
getline(tokenizer, token, ',');
istringstream int_iss(token);
cout << token << endl;
}
How can I make, that just one line get out, not the complete "example.txt"???
Thanks your help!
Sorry, I can't understand you, could you write it shot for me, please?
Könnten Sie es mir bitte genauer schreiben. Leider verstehe ich dich oder deinen Ausdruck nicht.
Vielen Dank :)