Clear Screen: clrscr() with Borland, only way I found with VC++ was system("cls") or one of the Console functions. For Unix, look at curses.
File: I would suggest using the file streams with C++, they're a lot easier to use (and more stable):If you don't know how long the key is, use a std::string object.Code:#include <iostream> #include <fstream> using namespace std; void somecode() { ifstream input("myfile"); if(!input) { // something went wrong, bail out here return; } char key[64]; // or however long your key is input.read(key, 64); }
Prototype: It's only concerned by the types you use, in this case you pass two ints to it, which is fine (it only uses the names within the function -- in fact you can supply only the type to the prototype and the definition of the function, you just can't reference it like that).
Return values: The function return value can be used almost anywhere:Code:#include <iostream> using namespace std; int function(int, int); int main() { int i = 5; int j = 4; cout << function(i, function(j, j)) << endl; } int function(int thing, int that) { return thing + that; }




Byte Me
Reply With Quote