MIPI_AdvancedC_FRTK/Lect2/47.c

16 lines
242 B
C
Raw Permalink Normal View History

2024-11-14 08:45:50 +03:00
#include <stdio.h>
int main(void)
{
{
char s[] = "Hello world";
s[0] = 'A'; // Так можно
}
{
char *s = "Hello world";
s[0] = 'A'; // ОШИБКА! read-only string
}
return 0;
}