Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. int main(void) {
  2.    
  3.     char outer = 'c';
  4.  
  5.     for(int i=0; i<10; i++) {
  6.         char inner = 'x';
  7.  
  8.         printf("%c", outer); // this works
  9.         printf("%c", inner); // this also works
  10.     }
  11.  
  12.     printf("%c", outer); // this works
  13.     printf("%c", inner); // this doesn't work because inner is only valid between the { } in the for loop.
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement