[an error occurred while processing this directive]
Не прописалось.. повт.
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено sss0 10 августа 2005 г. 16:14
В ответ на: Классический пример.. (ANSI) отправлено <font color=gray>sss0</font> 10 августа 2005 г. 16:09

для BC-3.1
-----------------


#include
#include
#include
#include

int main(void)
{
char *str;
/* allocate memory for string */
if ((str = (char *) malloc(10)) == NULL)
{
printf("Not enough memory to allocate buffer\n");
exit(1); /* terminate program if out of memory */
}
/* copy "Hello" into string */
strcpy(str, "Hello");
/* display string */
printf("String is %s\n", str);
/* free memory */
free(str);
return 0;
}