Consider the following tiny program in C: void hello() { printf(Hello, world ); } int main() {

Question:

Consider the following tiny program in C:
void hello() {
        printf("Hello, world\n");
}
int main() {
        hello();
}

(a) Split the program into two separately compiled files, tiny.c and hello.c. Be sure to create a header file hello.h and include it correctly in tiny.c.

(b) Reconsider the program as C++ code. Put the hello function in a separate namespace, and include an appropriate using declaration in tiny.c.

(c) Rewrite the program in Java, with main and hello in separate packages.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: