Передача структуры в функцию - C (СИ) (74119)
Формулировка задачи:
#include <stdio.h>
#define DEBUG 1;
typedef struct
{
int worksBefore;
int firstEvent;
int secondEvent;
int time;
int earlyStart;
int lateStart;
int earlyFinish;
int lateFinish;
} work;
void getEvents( work * w);
int main( void )
{
work a = {};
getEvents( &a );
return 0;
}
void getEvents( work * w )
{
if ( DEBUG )
printf( "\nEntry to the function 'getEvents'" );
printf("\nEnter first event: ");
scanf( "%d", w->firstEvent );
if ( DEBUG )
printf( "\n'Work.firstEvent' receive value %d", w->firstEvent );
printf("\nEnter second event: ");
scanf( "%d", w->secondEvent );
}if ( DEBUG )
printf( "\nEntry to the function 'getEvents'" );Решение задачи: «Передача структуры в функцию»
textual
Листинг программы
#define DEBUG 1