2 added 366 characters in body
source | link

Print a Variable's Memory Address

Similar to this puzzle I posted earlier, with a difference that should make this challenge easier.

Create a function (not a full program) that prints or returns the memory address of the parameter passed in. Literal values should return a falsey value.

Examples:

var foo = 4901
var bar = "foobarbaz"
var baz = true

getMemoryAddress(from: foo) // 0x00000000004030f0
getMemoryAddress(from: bar) // 0x00000000004030f8
getMemoryAddress(from: baz) // 0x0000000000403110
getMemoryAddress(from: "Bad Value") // false

Note that you probably won't get the same exact result as show above.

Print a Variable's Memory Address

Similar to this puzzle I posted earlier, with a difference that should make this challenge easier.

Create a function (not a full program) that prints or returns the memory address of the parameter passed in. Literal values should return a falsey value.

Print a Variable's Memory Address

Similar to this puzzle I posted earlier, with a difference that should make this challenge easier.

Create a function (not a full program) that prints or returns the memory address of the parameter passed in. Literal values should return a falsey value.

Examples:

var foo = 4901
var bar = "foobarbaz"
var baz = true

getMemoryAddress(from: foo) // 0x00000000004030f0
getMemoryAddress(from: bar) // 0x00000000004030f8
getMemoryAddress(from: baz) // 0x0000000000403110
getMemoryAddress(from: "Bad Value") // false

Note that you probably won't get the same exact result as show above.

1
source | link

Print a Variable's Memory Address

Similar to this puzzle I posted earlier, with a difference that should make this challenge easier.

Create a function (not a full program) that prints or returns the memory address of the parameter passed in. Literal values should return a falsey value.