Update main.cpp
This commit is contained in:
parent
2ff6658d08
commit
ef5ba0caee
2
.replit
2
.replit
|
@ -1,2 +1,2 @@
|
|||
language = "cpp"
|
||||
run = "g++ src/*.cpp -o compress -std=c++1y; echo Compilation done; ./compress"
|
||||
run = "g++ src/*.cpp -o compress -std=c++1y; echo Compilation done; ./compress soc1.txt 50"
|
||||
|
|
|
@ -1 +1,6 @@
|
|||
# Compression-Project
|
||||
# Compression-Project
|
||||
|
||||
## Usage
|
||||
|
||||
Compile: `g++ src/*.cpp -o compress -std=c++1y`
|
||||
Run: `./compress [input file] [compression ratio]`
|
10
src/main.cpp
10
src/main.cpp
|
@ -312,14 +312,14 @@ int initsize=0;
|
|||
int compressrate;
|
||||
int targetsize;
|
||||
|
||||
int main() {
|
||||
int main(int argc, char *argv[]) {
|
||||
string input="";
|
||||
|
||||
string input_file = "soc1.txt";
|
||||
string input_file = argv[1];
|
||||
//cin >> input_file;
|
||||
|
||||
string line;
|
||||
cin>>compressrate;
|
||||
compressrate = atoi(argv[2]);
|
||||
ifstream stin(input_file);
|
||||
compressrate = 100 - compressrate;
|
||||
|
||||
|
@ -375,7 +375,11 @@ int main() {
|
|||
|
||||
//where can i find a library of words in categories can't find any
|
||||
// not really sure
|
||||
// im not getting anywhere with weighting lol
|
||||
// there is no list i can find
|
||||
|
||||
|
||||
//!!! are we counting input size correctly bc the \r issue?
|
||||
s = huffmancompress(s);
|
||||
int orig_size = 0;
|
||||
ifstream testin(input_file);
|
||||
|
|
Loading…
Reference in a new issue