Question.1
Two driver modules both define an init() function:
namespace UART { void init() { /* UART setup */ } } namespace SPI { void init() { /* SPI setup */ } } UART::init(); SPI::init();
Will this compile?
Select Answer
No -- two functions with the same name cause a linker error
Yes -- namespaces provide separate scopes; UART::init and SPI::init are distinct symbols
UART::init
SPI::init
Yes -- but only if they have different parameter lists (overloading)
No -- namespaces cannot contain functions