-
-
Save modeverv/4c1a77a4fbd0f98a6eebaf51a09c3a21 to your computer and use it in GitHub Desktop.
c言語の遊び
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
char *a = "abc"; | |
printf("%s\n",a); | |
int i = 0; | |
for(i=0; *(a + i) != '\0'; i++){ | |
printf("%c\n",*(a+i)); | |
} | |
for(i=0; a[i] != '\0'; i++){ | |
printf("%c\n",a[i]); | |
} | |
for(; *a != '\0'; ){ | |
printf("%c\n",*a); | |
a++; | |
} | |
for(; *a != '\0'; ){ | |
printf("%c\n",*a); | |
a++; | |
} | |
char *str_ar[] = {"12","3456"}; | |
for(i=0;i<2;i++){ | |
char *x = str_ar[i]; | |
printf("%s\n",x); | |
for(; *x != '\0'; ){ | |
printf("%c\n",*x); | |
x++; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment