Question: Consider the following tiny program in C: void hello() { printf(Hello, world ); } int main() { hello(); } (a) Split the program into two
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.
Step by Step Solution
3.45 Rating (171 Votes )
There are 3 Steps involved in it
a File tinyc b File tinycc c F... View full answer
Get step-by-step solutions from verified subject matter experts
