Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for chris-barryâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #277331 |
@lundin Interestingly, _6.5.6/8_ places restrictions on pointer arithmetic. As a not-too-contrived-example, imagine a user selects from a list numbered from one up. This is used to index a zero-based array. A simple approach would be to create a pointer to element -1 then add the user's selection to ... (more) |
— | over 3 years ago |
Comment | Post #277331 |
@lundin True. The only way to determine that something is undefined is to look at the definition. Your example, however, is inappropriate as it attempts to dereference an out-of-bounds element and the OP says: "even without dereferencing it". (more) |
— | over 3 years ago |
Comment | Post #277331 |
@klutt No. I am saying that it will not compile because you ar trying to assign a value of type char to a variable of type pointer. However, even if the types were made to match (by making arr an array of pointers to char, rather than an array of char) your code sample would not illustrate your quest... (more) |
— | over 3 years ago |