47 lines
934 B
C
47 lines
934 B
C
#include <stdio.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
int numbers[4] = {0};
|
|
char name[4] = {'a'};
|
|
|
|
printf("numbers: %d %d %d %d\n",
|
|
numbers[0], numbers[1],
|
|
numbers[2], numbers[3]);
|
|
|
|
printf("name each: %c %c %c %c\n",
|
|
name[0], name[1],
|
|
name[2], name[3]);
|
|
|
|
printf("name: %s\n", name);
|
|
|
|
numbers[0] = 1;
|
|
numbers[1] = 2;
|
|
numbers[2] = 3;
|
|
numbers[3] = 4;
|
|
|
|
name[0] = 'Z';
|
|
name[1] = 'e';
|
|
name[2] = 'd';
|
|
name[3] = '\0';
|
|
|
|
printf("%d\n", name[0]);
|
|
printf("%d\n", name[1]);
|
|
printf("%d\n", name[2]);
|
|
printf("%d\n", name[3]);
|
|
|
|
printf("name as int=%d\n", (int)name);
|
|
|
|
printf("numbers: %d %d %d %d\n",
|
|
numbers[0], numbers[1],
|
|
numbers[2], numbers[3]);
|
|
|
|
printf("name each: %c %c %c %c\n",
|
|
name[0], name[1],
|
|
name[2], name[3]);
|
|
|
|
printf("name: %s\n", name);
|
|
|
|
return 0;
|
|
}
|