Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Name : FERRY FERDIAN
- Class : IT1 - 2010
- StudentID : 001201000037
- Subject : Network Programming
- */
- #include <iomanip>
- #include <iostream>
- #include <string>
- #include <windows.h>
- #include <unistd.h>
- using namespace std;
- string getexepath()
- {
- char result[ MAX_PATH ];
- return string( result, GetModuleFileName( NULL, result, MAX_PATH ) );
- }
- int main( int argc, char* argv[] )
- {
- cout << "The name used to start the program: " << argv[ 0 ]
- << "\nArguments are:\n";
- for (int n = 1; n < argc; n++)
- cout << setw( 4 ) << n << ": " << argv[ n ] << '\n';
- cout << "\nThe path of the file: " << getexepath() << "\n\n";
- char directory[_MAX_PATH];
- getcwd(directory, sizeof(directory));
- cout<< "The current working directory is: " << directory << "\n\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement