Advertisement
Guest User

Untitled

a guest
Aug 15th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. -----------------------program1.c
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <stdlib.h>
  5.  
  6. void check(char *a){
  7.     printf("%c\n", a);
  8. }
  9.  
  10. int main(void){
  11.     check("hello world");
  12.     return 0;
  13. }
  14. -------------------------
  15. >  ( or "H", but not "h" )
  16. >
  17. ( not as i expected )
  18. -------------------------program2.c
  19. #include <stdio.h>
  20. #include <string.h>
  21. #include <stdlib.h>
  22. int main(void){
  23.     char arr[] = "hello_world";
  24.     char *p = arr;
  25.     printf("%c\n", *p);
  26.     return 0;
  27. }
  28. -------------------------
  29. > h
  30. >
  31. ( as i expected )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement