Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include "Cipher.h"
- using namespace std;
- void performAction( );
- string getInput( string );
- string openFile( string, bool );
- int main (int argc, char * const argv[]) {
- // insert code here...
- std::cout << "Hello, World!\n";
- performAction();
- return 0;
- }
- string getInput( string sMessage )
- {
- string sInput;
- cout << sMessage << "\n";
- //cin >> sInput;
- getline(cin, sInput); // Something happens here :(
- return sInput; // And here that goes bonko!
- }
- void performAction( )
- {
- // ERROR HAPPENS HERE-ISH
- string sTemp = getInput( "Please enter a keyword:" );
- cout << sTemp << "\n";
- //Cipher oCiph( "LEMON", true );
- string sFile = getInput( "Please Choose a File:" );
- while ( sFile.length() == 0 )
- {
- cout << "Invalid file name";
- sFile = getInput( "Please Choose a File: " );
- }
- }
- Hello, World!
- Please enter a keyword:
- test
- CIS_Assign5(13802) malloc: *** error for object 0x10000c780: pointer being freed was not allocated
- *** set a breakpoint in malloc_error_break to debug
- Program received signal: “SIGABRT”.
- (gdb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement