Asterisk is the 1 open source communications toolkit. Need a Phone System? Build your own custom system with Asterisk? Buy a powerful, low-cost turnkey system based on Asterisk? Discover which option is right for you. Get the Guide. Learn More. Asterisk News. Asterisk View All. Security Advisories. What can we help you find? Asterisk Applications Features Glossary. Other Resources. With gdb you can play and experiment:. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Pointers in C: when to use the ampersand and the asterisk? Ask Question. Asked 11 years, 11 months ago. Active 5 months ago. Viewed k times. Pieter Pieter Please illustrate how you see things sometimes working differently. Otherwise, we have to guess what it is that's confusing you. Agree with Neil Butterworth. I disagree with all of you who say that its not a good idea to ask these types of questions on SO.
SO has become the number 1 resource when searching on Google. You're not giving enough credit to these answers. Read Dan Olson's response. This answer is truly insightful and incredibly helpful to newbies. RTFM is unhelpful, and quite frankly very rude.
If you don't have time to answer, then be respectful of those who take time to answer these questions. What SSH This said is absolutely true. Some people shout "Just Google it", but nowadays it's the other way around: "Just look on StackOverflow. Hence the upvotes and no downvotes. Show 1 more comment. Active Oldest Votes. Dan Olson Dan Olson How come this doesn't work? Arrays are special and can be converted to pointers transparently. This highlights another way to get from a pointer to a value, I'll add it to the explanation above.
If I understand this correctly Is this correct? You're correct, although there are cases where you may actually want the address of the address. Show 3 more comments. Thus, when you call a function with an array expression as an argument, the function will receive a pointer, not an array: int arr[10]; Because of how array subscripting is defined, you can use a subscript operator on a pointer the same way you can use it on an array: int arr683; init arr, N ; Bluefire 12k 22 22 gold badges 66 66 silver badges bronze badges.
John Bode John Bode k 17 17 gold badges silver badges bronze badges. Add a comment. Legorooj 2, 2 2 gold badges 14 14 silver badges 31 31 bronze badges.
Jay Conrod Jay Conrod I think you are a bit confused. Prasoon Saurav Prasoon Saurav Actually, you have it down pat, there's nothing more you need to know :- I would just add the following bits: the two operations are opposite ends of the spectrum.
As to things working differently, not really: arrays, as already mentioned, degrade to pointers to the first element in the array when passed to functions; they don't preserve size information. When you pass the address of a variable to a function, you can de-reference the pointer to change the variable itself normally variables are passed by value except for arrays. Ok, looks like your post got editted Stanford CS by Jerry Cain Another very valuable tool is gdb where you have an interactive shell like you have, for example, in python.
With gdb you can play and experiment: gdb x pp. The Overflow Blog.
0コメント