000
30.01.2010, 17:09 Uhr
Nicolon
|
Ich wollte ein Programm schreiben das bei eingabe von buchstaben das Programm sie ausgibt und am ende in ein textdokument schreibt aber warum öffnet der das Textdokument nicht :/
C++: |
#include <math.h> #include <windows.h> #include <conio.h> #include <cstdlib> #include <iostream> #include <stdio.h>
const unsigned char AE = static_cast<unsigned char>(142); const unsigned char ae = static_cast<unsigned char>(132); const unsigned char OE = static_cast<unsigned char>(153); const unsigned char oe = static_cast<unsigned char>(148); const unsigned char UE = static_cast<unsigned char>(154); const unsigned char ue = static_cast<unsigned char>(129); const unsigned char ss = static_cast<unsigned char>(225);
//----------------------------------------------------------------------------//
using namespace std;
int main()
//----------------------------------------------------------------------------//
{ SetConsoleTitle("Morsecode Programm 2.0"); system("color 1F"); //----------------------------------------------------------------------------// char zeichen; int eing2, sn, k, l, p, fh, ft; int eing=1; k= 1000; l= 2000; p= 25; fh= 500; ft= 200; while(eing!=2) { system("cls"); cout << "\nMorsecode Programm 2.0"; cout << "\n---------------------------"; cout << "\nMen"<<ue<<":"; cout << "\n\nProgramm starten -> (1)"; cout << "\nBeenden -> (2)"; cout << "\nHilfe -> (3)"; cout << "\n\nIhre Eingabe: "; cin >> eing; system("cls"); switch(eing) { case 1 : ofstream log("mies.txt"); system("cls"); cout << "\nSie k"<<oe<<"nnen nun einen Buchstaben eintippen [ZUM BEENDEN STRG + C DR"<<UE<<"CKEN]: \n\n"; while(zeichen=getch()) { switch(zeichen) { case 'a' : case 'A' : cout << "A"; break; case 'b' : case 'B' : cout << "B"; break; case 'c' : case 'C' : cout << "C"; break; case 'd' : case 'D' : cout << "D"; break; case 'e' : case 'E' : cout << "E"; break; case 'f' : case 'F' : cout << "F"; break; case 'g' : case 'G' : cout << "G"; break; case 'h' : case 'H' : cout << "H"; break; case 'i' : case 'I' : cout << "I"; break; case 'j' : case 'J' : cout << "J"; break; case 'k' : case 'K' : cout << "K"; break; case 'l' : case 'L' : cout << "L"; break; case 'm' : case 'M' : cout << "M"; break; case 'n' : case 'N' : cout << "N"; break; case 'o' : case 'O' : cout << "O"; break; case 'p' : case 'P' : cout << "P"; break; case 'q' : case 'Q' : cout << "Q"; break; case 'r' : case 'R' : cout << "R"; break; case 's' : case 'S' : cout << "S"; break; case 't' : case 'T' : cout << "T"; break; case 'u' : case 'U' : cout << "U"; break; case 'v' : case 'V' : cout << "V"; break; case 'w' : case 'W' : cout << "W"; break; case 'x' : case 'X' : cout << "X"; break; case 'y' : case 'Y' : cout << "Y"; break; case 'z' : case 'Z' : cout << "Z"; break; case 9 : cout << " "; break; case 32 : cout << " "; break; case 13 : cout << "\n"; break; case 8 : cout << "\b"; break; default : cout << " KENN ICH NICHT "; break; log << zeichen; } } break; case 2 : cout << "\n\nBis Bald!"; Sleep(1000); eing=2; return(0); break; log.close(); case 3 : cout << "\n\nDieses Programm fragt den Benutzer\nnach einem beliebigen Buchstaben"; cout << " des Alphabets und gibt den dazugeh"<<oe<<"rigen\nMorsecode aus.\n\nBitte warten..."; Sleep(6000); break; log.close(); default : system("cls"); cout << "UNG"<<UE<<"LTIGE EINGABE"; Sleep(1200); eing=1; break; log.close(); } } }
|
Folgende Compiler (DEV C++) Meldung kommt
66 variable `std::ofstream log' has initializer but incomplete type
Kann jmd helfen? |