-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add manipulation function to pointer example #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. Please see the review comments.
) | ||
|
||
func main() { | ||
b := 255 | ||
var a *int = &b //Saving b's address into variable a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mmichaelb for the valuable contribution.
I think its better so start with basic things first like how to declare a pointer, what is the significance of '*' and '&' sign. So please add some code comments related to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely agree with you on this one. However, my pull request/referred issue was really only about the implementation of the pointer function to show another Pointer related feature. Anyway, I am happy to deal with this matter as part of another issue.
|
||
size := new(int) // we can imagine that "new" keyword is a pointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add correct definition of new as its a built in function that allocates memory and return address of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As already mentioned, the same applies for this one. I totally agree with you but this pull request/issue simply does not address this topic/problem. In order to maintain the issue structure, I would rather deal with this problem in another issue/pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to maintain the issue structure, I would rather deal with this problem in another issue/pull request.
I really appreciate that! Thank you. Merging this request and will open new issues for improvement of code comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a lot of comments as readers usually find this topic difficult to learn it would be better to help them as much as you can. Dig deeper in this topic and it will also help you in your life.
@mmichaelb I appreciate your contribution 👍 #73 & #83 is created for improvement related to this PR. Can you have a look into those issues? |
Sure, of course! Right now I'm pretty busy at work, but I'll see that I can find a few minutes 😉 |
@mmichaelb Take Your Time :) |
Implements the feature from #21