Bird
0
0

Which of the following is the correct way to call vTaskGetRunTimeStats() to store the stats in a buffer named buffer?

easy📝 Syntax Q12 of 15
FreeRTOS - Debugging and Monitoring
Which of the following is the correct way to call vTaskGetRunTimeStats() to store the stats in a buffer named buffer?
AvTaskGetRunTimeStats(buffer);
BvTaskGetRunTimeStats(&buffer);
CvTaskGetRunTimeStats(buffer[]);
DvTaskGetRunTimeStats(*buffer);
Step-by-Step Solution
Solution:
  1. Step 1: Check function parameter type

    vTaskGetRunTimeStats() expects a pointer to a char array (string buffer), so passing the buffer name directly is correct.
  2. Step 2: Analyze each option's syntax

    vTaskGetRunTimeStats(buffer); passes the buffer correctly. vTaskGetRunTimeStats(&buffer); passes address of buffer pointer (wrong). vTaskGetRunTimeStats(buffer[]); uses invalid syntax. vTaskGetRunTimeStats(*buffer); dereferences buffer incorrectly.
  3. Final Answer:

    vTaskGetRunTimeStats(buffer); -> Option A
  4. Quick Check:

    Pass buffer name directly [OK]
Quick Trick: Pass buffer name directly, no & or * needed [OK]
Common Mistakes:
  • Using &buffer which is wrong for arrays
  • Adding [] inside function call
  • Dereferencing buffer pointer incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes