fork(1) 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 ;
  10.  
  11. for(ptr = &text[0][0] ; ptr < &text[0][0]+(lines*MAX_LEN) ; ptr+=MAX_LEN)
  12. {
  13. if(*ptr >= 'a' && *ptr<= 'z')
  14. *ptr-= ('a' - 'A');
  15. }
  16. for(ptr = &text[0][0] ; ptr < &text[0][0]+(lines*MAX_LEN) ; ptr+=MAX_LEN)
  17. {
  18. puts(ptr);
  19.  
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
Hi
Bye
Kuku
Shalom