Advertisement
MrHalabaluza

Untitled

Oct 26th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include "stdio.h"
  2. #include "stdlib.h"
  3. #include "string.h"
  4.  
  5. notLatinClear(char str[]){
  6.     int i = 0;
  7.     int n = 0;
  8.     char * str2;
  9.     str2 = malloc(strlen(str) * sizeof(char));
  10.     if (!str2)
  11.         return 1;
  12.     while (str[i] != '\0'){
  13.         str2[i] = 0;
  14.         if ((str[i] >= 'a') && (str[i] <= 'z')){
  15.             str2[n] = str[i];
  16.             n++;
  17.         }
  18.         else{
  19.             if ((str[i] >= 'A') && (str[i] <= 'Z')){
  20.                 str2[n] = str[i] + 32;
  21.                 n++;
  22.             }
  23.         }
  24.         i++;
  25.     }
  26.     return str2;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement