Create a `Secret` class with a private integer `code` set via constructor. Declare `class Agent` as a friend inside `Secret`. Create the `Agent` class with a method `void reveal(Secret s)` that prints ‘Code: [code]’. Read an integer, instantiate `Secret`, instantiate `Agent`, and call `reveal`.
A single integer.
Print the formatted code.
None
007
Code: 7
When an entire class is declared as a friend, all of its member functions gain access to the private data of the granting class.
#include <iostream>
class Secret {
// Define private member, constructor, and friend class declaration
};
class Agent {
public:
// Implement reveal()
};
int main() {
// Read input, instantiate Secret and Agent, call reveal
return 0;
}Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used