LINUX.ORG.RU

Сообщения Cycle_A

 

Знатокам стандарта Си

Есть ли undefined behavior в нижеприведённом коде (C99)?

#include <string.h>
#include <stdio.h>

char *
foo(char *s)
{
    strcpy(s, "hello");
    return s;
}

int
main()
{
    puts(foo((char [64]) {'\0'})); // будет ли этот char[64] жив после возврата foo?
}

 

Cycle_A
()

RSS подписка на новые темы