Advertisement
CotaIgnorada

Variables estática

Oct 23rd, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. void print_value(){
  5.          
  6.         static value=0;
  7.        printf("value: %d\n",value);
  8.        value++;
  9. }
  10.  int main(){
  11.          int i=0:
  12.          for(i=0;i<5; i++){
  13.                print_value();
  14.  
  15.               return (EXIT_SUCCESS);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement