Okay, when I try to compile this with Dev-C++ I get this error on line 29, "invalid operands to binary +".
It is my version of an encryption program, and can be cracked without much effort with a computer, so don't say that my encryption is bad, it's just for practice right now.
Question
Ultra Frosty
Okay, when I try to compile this with Dev-C++ I get this error on line 29, "invalid operands to binary +".
It is my version of an encryption program, and can be cracked without much effort with a computer, so don't say that my encryption is bad, it's just for practice right now.
#include <stdio.h> int main(int argc, char *argv[]) { if(argc != 2) { printf("Syntax: %s <filename>", argv[0]); } int * int_pass; int * int_text; char * char_pass; char * char_text; printf("Enter a Password: "); scanf("%s", &char_pass); int_pass = (int*)char_pass; /* Convert to #'s */ printf("Enter Text: "); scanf("%s", &char_text); int_text = (int*)char_text; /* Convert to #'s */ FILE * makeFile; makeFile = fopen(argv[1], "wt"); int encrypted; encrypted = int_text + int_pass; fprintf(makeFile, "%d", encrypted); fclose(makeFile); return 0; }Link to comment
Share on other sites
1 answer to this question
Recommended Posts