Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Last active October 12, 2016 14:13
Show Gist options
  • Save AndyNovo/f7d68f7098640ce8faaa1b432219cbd8 to your computer and use it in GitHub Desktop.
Save AndyNovo/f7d68f7098640ce8faaa1b432219cbd8 to your computer and use it in GitHub Desktop.
#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