Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- // Initiera variabler
- int firstvalue, secondvalue;
- // Initiera pointer
- int *mypointer;
- // Set pointer to firstvalue address
- mypointer = &firstvalue;
- // Set the value of the pointed object
- *mypointer = 10;
- // Set pointer to secondvalue address
- mypointer = &secondvalue;
- // Set the value of the pointed object
- *mypointer = 20;
- // Print the firstvalue value
- printf("First value: %i\n", firstvalue);
- // Print the secondvalue value
- printf("Second value: %i\n", secondvalue);
- }
Add Comment
Please, Sign In to add comment