[an error occurred while processing this directive]
|
for BC-3.1
-----------------
#include int main(void) /* allocate memory for string */ /* copy "Hello" into string */ /* display string */ /* free memory */ return 0;
E-mail:
info@telesys.ru
#include
#include
#include
{
char *str;
if ((str = (char *) malloc(10)) == NULL)
{
printf("Not enough memory to allocate buffer\n");
exit(1); /* terminate program if out of memory */
}
strcpy(str, "Hello");
printf("String is %s\n", str);
free(str);
}
Ответы