Last active
October 12, 2016 14:13
-
-
Save AndyNovo/f7d68f7098640ce8faaa1b432219cbd8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
#include <cstring> | |
using namespace std; | |
int main(int argc, char* argv[]){ | |
long* ptr = new long; | |
long value = 15; | |
char user[20]; | |
char dev[] = "Andy"; | |
strncpy(user, argv[1], strlen(argv[1])); | |
*ptr = value; | |
cout << "My name is " << dev << endl; | |
cout << "Your name is " << user << endl; | |
cout << "The pointer has value " << *ptr << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment