Supposing we have:Many introductions to C++ (like this one) suggest that the rvalues a+i and &a[i] are interchangeable. I naively believed this for several decades, until I recently stumbled upon the following text (here) quoted from [dcl.ref]:
Here is a smart pointer: std::shared_ptr<char> p(new char[size]) which represents array filled with raw binary file content. After (and only after) the whole array is copied from file to RAM, I can parse it, and during this I retrieve some header information (a few first dwords). Then actual data follows.
Inspired by comments to my answer here.Is this sequence of steps legal in C standard (C11)?Or equivalently as code:
In the book, "Understand and Using C Pointers" by Richard Reese it says on page 85,The code generated by vector[i] is different from the code generated by *(vector+i) . The notation vector[i] generates machine code that starts at location vector , moves i positions from this location, and uses its...
Based on this Question ( strange output issue in c) there was an Answer ( provided by @Lundin ) about this line:
I am C novice but been a programmer for some years, so I am trying to learn C by following along Stanford's course from 2008 and doing Assignment 3 on Vectors in C.