May 17, 2015 #1 K klun Junior Member level 2 Joined May 1, 2015 Messages 20 Helped 0 Reputation 0 Reaction score 0 Trophy points 1 Activity points 386 Code C - [expand]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 void main(void) { unsigned long L = 1, R = 2; BLOWFISH_CTX ctx; using namespace std; string input = ""; cout << "Please enter a valid sentence (with spaces):\n>"; getline(cin, input); cout << "You entered: " << input << endl << endl; Blowfish_Init (&ctx, (unsigned char*)(input.c_str), 7); //line with error Blowfish_Encrypt(&ctx, &L, &R); printf("%08lX %08lX\n", L, R); if (L == 0xDF333FD2L && R == 0x30A71BB4L) printf("Test encryption OK.\n"); Can anyone help me with that error? Last edited by a moderator: May 17, 2015
Code C - [expand]1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 void main(void) { unsigned long L = 1, R = 2; BLOWFISH_CTX ctx; using namespace std; string input = ""; cout << "Please enter a valid sentence (with spaces):\n>"; getline(cin, input); cout << "You entered: " << input << endl << endl; Blowfish_Init (&ctx, (unsigned char*)(input.c_str), 7); //line with error Blowfish_Encrypt(&ctx, &L, &R); printf("%08lX %08lX\n", L, R); if (L == 0xDF333FD2L && R == 0x30A71BB4L) printf("Test encryption OK.\n"); Can anyone help me with that error?
May 17, 2015 #2 H horace1 Advanced Member level 5 Joined Nov 18, 2008 Messages 2,118 Helped 596 Reputation 1,188 Reaction score 571 Trophy points 1,393 Location Norwich, UK Activity points 13,063 string member c_str is a member function, e.g. try it with parameters () Code: Blowfish_Init (&ctx, (unsigned char*)(input.c_str()), 7); //line with error
string member c_str is a member function, e.g. try it with parameters () Code: Blowfish_Init (&ctx, (unsigned char*)(input.c_str()), 7); //line with error