Why isn't there a pointer in Python?

Asked 2 years ago, Updated 2 years ago, 45 views

I have a question while studying the language pointer Any language is basically in memory We have no choice but to use variables and addresses Is it because Python doesn't need an address? Or is it because there is a substitute?

pointer python c

2022-09-21 19:47

1 Answers

It depends on how you look at it, but...

Python also has a pointer.

However, it is not possible to allocate or operate memory directly like language c.

This is the same as the language that does not have a pointer, such as Java or Dotnet.

So how do you use memory...

Use a function called Reference to use the memory address.

When you create an object, it is created in the heap memory space and the memory address is stored in the local variable, etc.

This allows you to control the stored variables.


2022-09-21 19:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.