SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. #define DIM 100
  4.  
  5. int strlon(char *stringa){
  6.     int i;
  7.    
  8.     for(i=0; *(stringa + i) != '\n'; i++){
  9.     }
  10.    
  11.     return i;
  12. }
  13.  
  14. int main(){
  15.     char stringa[DIM];
  16.    
  17.     printf("Inserisci una stringa: ");
  18.    
  19.     fgets(stringa,DIM,stdin);
  20.    
  21.     printf("La stringa รจ lunga %d caratteri.\n",strlon(stringa));
  22.    
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top