Suggestions
Use up and down arrows to review and enter to select.Please wait while we process your payment
If you don't see it, please check your spam folder. Sometimes it can end up there.
If you don't see it, please check your spam folder. Sometimes it can end up there.
Please wait while we process your payment
By signing up you agree to our terms and privacy policy.
Don’t have an account? Subscribe now
Create Your Account
Sign up for your FREE 7-day trial
Already have an account? Log in
Your Email
Choose Your Plan
Individual
Group Discount
Save over 50% with a SparkNotes PLUS Annual Plan!
Purchasing SparkNotes PLUS for a group?
Get Annual Plans at a discount when you buy 2 or more!
Price
$24.99 $18.74 /subscription + tax
Subtotal $37.48 + tax
Save 25% on 2-49 accounts
Save 30% on 50-99 accounts
Want 100 or more? Contact us for a customized plan.
Your Plan
Payment Details
Payment Summary
SparkNotes Plus
You'll be billed after your free trial ends.
7-Day Free Trial
Not Applicable
Renews December 5, 2023 November 28, 2023
Discounts (applied to next billing)
DUE NOW
US $0.00
SNPLUSROCKS20 | 20% Discount
This is not a valid promo code.
Discount Code (one code per order)
SparkNotes PLUS Annual Plan - Group Discount
Qty: 00
SparkNotes Plus subscription is $4.99/month or $24.99/year as selected above. The free trial period is the first 7 days of your subscription. TO CANCEL YOUR SUBSCRIPTION AND AVOID BEING CHARGED, YOU MUST CANCEL BEFORE THE END OF THE FREE TRIAL PERIOD. You may cancel your subscription on your Subscription and Billing page or contact Customer Support at custserv@bn.com. Your subscription will continue automatically once the free trial period is over. Free trial is available to new customers only.
Choose Your Plan
For the next 7 days, you'll have access to awesome PLUS stuff like AP English test prep, No Fear Shakespeare translations and audio, a note-taking tool, personalized dashboard, & much more!
You’ve successfully purchased a group discount. Your group members can use the joining link below to redeem their group membership. You'll also receive an email with the link.
Members will be prompted to log in or create an account to redeem their group membership.
Thanks for creating a SparkNotes account! Continue to start your free trial.
Please wait while we process your payment
Your PLUS subscription has expired
Please wait while we process your payment
Please wait while we process your payment
Ok, that's not exactly true. Pointers and arrays are not exactly the same entity, but they're very close. In fact, an array is for all intents and purposes a constant pointer.
What?! How can an array be a pointer, and how can a pointer be an array? Before we delve into that question, we first need to discuss pointer arithmetic.
If you have an integer variable, you can add the number 1 to it and the contents f that variable will increase by 1. You could add an 'a' to a character variable and it would increase by the value 'a'. With pointers, arithmetic is also possible, but a little quirky. Once we understand how pointer arithmetic works, however, it is an invaluable aid. In fact, as we'll see, arrays work properly because of pointer arithmetic.
As we've seen, pointers store an address in memory. If we have an integer pointer, it points to a memory location that can hold an integer. If we have a character pointer, it points to an address in memory that can hold a character. And so forth. So all a pointer really holds is a big number, say, for example, 0x4b14 (or in binary 0b0100101100010100). We might expect that if we added a number to this, say the number 1, that the pointer would then hold the number 0x4b15. Fortunately, that is not always the case.
When you add numbers to pointers, the address stored in the pointer isn't necessarily increased by that many bytes. That would cause trouble, for example, with an integer pointer. Let's say we had a series of integers in a row located at addresses 0x4b14, 0x4b18, 0x4b1b, and 0x4b1f (remember that integers on most modern machines, and the example machine we're dealing with here, are a 4-byte data type, meaning they take up 4 bytes). Let's say that we have a pointer ptr that currently holds the address 0x4b14. If we executed the instruction: ptr = ptr + 1; without special arithmetic, if ptr were just an integer variable, we would end up with the value 0x4b15. But this number doesn't make any sense in terms of memory addresses. A single integer resides at the memory addresses 0x4b14 through 0x4b17, so accessing the memory at address 0x4b15 would be accessing into the middle of an integer. Fortunately, this is not how pointer arithmetic works.
When you add a number to a pointer, the computer knows what type of data the pointer points to, and multiplies the number you're adding by the size of the pointer's type before adding it to the pointer. For example, taking the case from above, if we have the following code:
Please wait while we process your payment