Co ten program wypisze na konsolę?
#include "stdio.h"
#include "stdint.h"
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
int main(void)
{
int a = 5;
int b = 3;
printf("%d,", MAX(a++, b));
printf("%d,", a);
printf("%d\n", b);
return 0;
}
Jakie pliki możemy dołączyć za pomocą dyrektywy #include?
#define THRESHOLD_ADC R2 * ADC_RAW_MAX * V_T / (R1 + R2) / ADC_V_MAX
void log_print(const char *format, ...);
Co ten kod wypisze na konsolę?
#include "stdio.h"
#include "stdint.h"
#define DISTANCE_PART1 500
#define DISTANCE_PART2 2000
#define DISTANCE_FULL DISTANCE_PART1 + DISTANCE_PART2
typedef int32_t speed_t;
typedef int32_t time_t;
speed_t calculate_speed(time_t time_part1, time_t time_part2)
{
return (time_part1 + time_part2) / DISTANCE_FULL;
}
int main(void)
{
printf("%d", calculate_speed(10000, 10000));
return 0;
}
void adc_init(void);
void adc_start(void);
void adc_stop(void);
Jaką datę i czas wskazują predefiniowane symbole __DATE__ oraz __TIME__
Czy da się umieścić dyrektywę #pragma wewnątrz #define?
Uzupełnij brakujące pola tak, żeby wypisać na konsolę dane z komentarzy
Uzupełnij ten kod tak, żeby osiągnąć opisany efekt
Dodaj komentarz