This is my first post and I am a complete novice at C programming. I am trying to teach myself C programming and using "Programming in C" by Stephen G. Kochan 3rd Ed. My problem is that I have a pointer that points to an array and I want it to do (what I assumed) was a simple 'for' loop to cycle through the elements of the array using this code:
but it loops through the code and doesn't stop (an infinite loop until it crashes).
for (arrPntr = array; arrPntr<(arrPntr+2); arrPntr++)
I have found a work around in :
but in my book, it says that the first example should work (for anyone who has the book it is Chap 11, page 262: Paraphrased "'valuesPtr > &values' is the same as ' valuesPtr > values + 99'".
for (arrPntr = array; arrPntr<&array; arrPntr++)
Could someone please tell me if:
1. I have made a mistake with my code (which I think is the case)
2. The text is incorrect or outdated, and if so please provide me with up to date information.
Thank you for any assistance you can offer.