Create a `Database` class with a `db_name` string attribute. Create a `Server` class whose constructor requires a `Database*` pointer passed into it. The `Server` constructor should print ‘Server connected to [db_name]’.
A single string for the database name.
Print the connection message.
No spaces in the string.
PostgreSQL
Server connected to PostgreSQL
Dependency Injection is a form of aggregation where a class receives its dependencies from the outside via pointers rather than creating them internally.
#include <iostream>
#include <string>
class Database {
public:
// Write your code here
};
class Server {
public:
// Write your code here
};
int main() {
// Inject Database pointer into Server
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