fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define MAX_LEN 20
  5.  
  6. int main() {
  7. char text[][MAX_LEN] = {"hi","bye","kuku","Shalom"};
  8. int lines = sizeof(text)/sizeof(text[0]);
  9. char (*ptr)[MAX_LEN];
  10. for(ptr = text ; ptr < text+lines ; ptr++) {
  11. char *firstLetter = *ptr;
  12. if(*firstLetter >= 'a' && *firstLetter <= 'z')
  13. *firstLetter -= ('a' - 'A');
  14. }
  15. for(ptr = text ; ptr < text+lines ; ptr++) {
  16. puts(*ptr);
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
Hi
Bye
Kuku
Shalom