Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5. char userInput[100];
  6. char *ptr = userInput[0];
  7. int i;
  8.  
  9. for(i = 0; i < 100; i++) {
  10. userInput[i] = NULL;
  11. }
  12.  
  13. printf("Enter a string:\n");
  14. scanf("%[^\n]", userInput);
  15.  
  16. for(i = 0; i < 100; i++) {
  17. printf("%p", *ptr);
  18. ptr++;
  19. }
  20.  
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement