Write a C++ program demonstrating that a reference cannot be reseated after initialization, unlike a pointer.
Two space-separated integers A and B.
Print reference value before and after attempting reassignment to show original variable holds updated alias target.
-10000 <= A, B <= 10000
10 20
Initial: 10 After Reassignment Assignment: 20
References remain bound to their initial target throughout their lifetime.
#include <iostream>
int main() {
int a, b;
if (std::cin >> a >> b) {
int &ref = a;
std::cout << "Initial: " << ref << "n";
ref = b; // Assigns value to a, doesn't reseat reference
std::cout << "After Reassignment Assignment: " << a << "n";
}
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