What does asterisk mean in c




















Add a comment. Active Oldest Votes. So, why didn't B use! Improve this answer. Community Bot 1. This is a great answer, MichaelT! You showed me both historical and practical reasons, and even stuff I didn't quite understand but could look into. Thank you. NoobSaibot The choice of character isn't as much of a deal as the fact that the operator is a prepend rather than postpend operator.

You might also mention that C found a use for almost every Ascii punctuation character. There weren't many spares. I guess would have been another possibility.

B also didn't use so there were a few more spares around then Unfortunately, Dennis Ritchie is no longer able to be asked he passed away in October of '11 while Kernighan is apparently still a professor in the CS Department at Princeton. Ken Thompson the other creator of B works at Google There may also have been issue with some keyboards indicated by the trigraphs for C for what we would think of as common keys suggesting that not all of them were available I'm not sure if ' ' was.

Show 3 more comments. The Overflow Blog. By the way, it looks like we will have official literals for arrays, dictionaries and some other objects in Xcode 4. Asked 3 Months ago Answers: 5 Viewed 42 times. And only in this case. It just makes no sense to me. Sydius outlined the types fairly well: Normal pointers are just that - they point to some thing in memory somewhere. Who owns it? Only the comments will let you know. Who frees it? Hopefully the owner at some point.

Smart pointers are a blanket term that cover many types; I'll assume you meant scoped pointer which uses the RAII pattern. Active Oldest Votes. Improve this answer. And yes, that's undefined behavior if p doesn't point to valid memory. Was a typo, I wrote from my phone Haris Nice Answer. This type of asterisk is for declaring a pointer, not for dereferencing. The Overflow Blog.

With an asterisk, the pointer references the value at that memory location. Always use the same type of pointer as the variables it examines: floats for floats , ints for ints , and so on. Remember: initialize a pointer before you use it!



0コメント

  • 1000 / 1000