Create a `Config` class with a private static integer `version` initialized to 1. Provide a public static member function `int getVersion()` that returns this value. In `main()`, call this static method directly via the class name and print ‘Version: [v]’.
None
Print the version formatted.
None
Version: 1
Static member functions can be called directly without an object and can only access static data members of the class.
#include <iostream>
class Config {
// Declare private static data and public static method
};
// Initialize static data
int main() {
// Call getVersion() statically and print
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