Files
Linux-C-Notes/C05-数组/char.c
2024-05-26 15:39:14 +08:00

28 lines
405 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <stdio.h>
#include <stdlib.h>
// #define N 10
#define N 32
int main( )
{
// char str[N] = {'a', 'b', 'c'};
char str[N] = "a";
scanf("%s", str);
// str数组名本身就是地址不需要&str
printf("%s", str);
// gets(str);
// puts(str);
// for (int i = 0; i < N; i++)
// {
// printf("%c ", str[i]);
// }
printf("\n");
exit(0);
}