Pointers are useful for accessing memory locations.Printf("Please remember these materials :\n") Pointers make it easy to access each array element. Traditionally, we access the array elements using its index, but this method can be eliminated by using pointers. The pointer will be increased or decreased by N times the number of byte (s) of the type of the variable. This allows the pointer to move N elements in a table. P1 and P2 point to the same integer variable In the latter case, parentheses are needed: as the unary operators * and are evaluated from right to left, without the parentheses the pointer P would be incremented, not the object on which P points.īelow table shows the arithmetic and basic operation that can be used when dealing with C pointers Operation The following expressions are equivalent: int X =10įor the above code, below expressions are true If a P pointer points to an X variable, then * P can be used wherever X can be written.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |