Показать сообщение отдельно

  #11  
Старый 17.02.2010, 21:10
NetSter
студент
Регистрация: 30.07.2007
Сообщений: 800
С нами: 9885926

Репутация: 1188


По умолчанию

Цитата:
Сообщение от mr_walker  
как работает эта программа? я в С оч.слаб... что будет на экране в результате работы программы? В самом коде могут быть ошибки...


пишет: Declaration terminated incorrectly
что не так?
еще один вариант.

Код:
#include <iostream>

int *sfirst_function(void);
int *isecond_function(void);

int * sfirst_function(void)
{
	int ilocal_to_first=11;
	return &ilocal_to_first;}

int *isecond_function(void)
{
	int ilocal_to_second=44;
	return &ilocal_to_second;
}
void main()
{
	int *pi=sfirst_function();
	printf("First Function = %d\n",*pi);
	int *si= isecond_function();
	printf("Second Function = %d\n",*si);
}
На экране надпись:
First Function =11
Second Function = 44
 
Ответить с цитированием