Advertisement
mariam65

Untitled

Jun 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.89 KB | None | 0 0
  1. #include <cs50.h>
  2. #include <stdio.h>
  3.  
  4. int main (void)
  5.  
  6. {
  7.  
  8.    
  9.    int hash =get_int();
  10.    int height = get_int();
  11.  
  12.    do
  13.  {
  14.    printf("height: ");
  15.    int height = get_int();
  16.    printf("you chose int %i" , height);
  17.  }
  18.   while
  19.    ( height < 1 || height > 24 );
  20.  
  21.   for
  22.    ( char hash = 0 ; hash > 1 ; hash++ )
  23.     printf (" # %i\n"  ,  hash );
  24.     printf("    %i\n" , hash );
  25.  
  26.  
  27.    
  28. }
  29.  
  30.  
  31. ERRORS
  32. mario.c:15:8: error: declaration shadows a local variable
  33.       [-Werror,-Wshadow]
  34.    int height = get_int();
  35.        ^
  36. mario.c:10:8: note: previous declaration is here
  37.    int height = get_int();
  38.        ^
  39. mario.c:22:11: error: declaration shadows a local variable
  40.       [-Werror,-Wshadow]
  41.    ( char hash = 0 ; hash > 1 ; hash++ )
  42.           ^
  43. mario.c:9:8: note: previous declaration is here
  44.    int hash =get_int();
  45.        ^
  46. 2 errors generated.
  47. make: *** [mario] Error 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement