#include /* printf */ #include #include #include #include #include "main.h" LZW::LZW(std::string fileName){ FILE * file; file = fopen (fileName.c_str(),"r"); if (file==NULL) perror ("Error opening file"); else{ fseek(file, 0, SEEK_END); // seek to end of file textLength = ftell(file); // get current file pointer fseek(file, 0, SEEK_SET); //back to the beginning of the file printf("Textlength: %d",textLength);//JAJ variable text längen! printf("\n"); text=new char[textLength]; for(int i=0;i<(textLength);i++){ text[i] = fgetc (file);//Char für char ausm text fischen printf("%c",text[i]);//Ausgabe der soeben eingelesenne Chars //if((i%50)==0) printf("\n"); } fclose (file); } alphabetLength=256; alphabet = new char[alphabetLength]; vorkommen = new int[alphabetLength]; wahrscheinlichkeit = new float[alphabetLength]; entscheidungsgehalt = new float[alphabetLength]; printf("\nVorhandenes Alphabet:\n"); for (int i=0; i%d",codiertInt[counter2]); if(codiertInt[counter2]<=decodeMusterCounter-1&&counter2