This is pretty embarrassing to admit, but I'm already lost in my Principles of CS II class. The book we're using Data Structures and Algorithm Analysis in Java, 2nd Edition by Mark Allen Weiss. I don't know if any of you are familiar with it, but it's written in such a way that nobody in my class understands what it's even trying to explain a good bit of the time, and even the professor himself doesn't understand some of the material in chapter one. Why we're still using it, then, I have no idea. But I've got some homework that's due tomorrow, and I'm stuck on one particular problem:
"C allows statements of the form
#include filename
which reads filename and inserts its contents in place of the include statement. Include statements may be nested; in other words, the file filename may itself contain an include statement, but, obviously, a file can't include itself in any chain. Write a program that reads in a file and outputs the file as modified by the include statements."
I don't even know where to begin on this. We didn't cover anything of this sort in Principles of CS I, and as seems to be the norm, Mr. Weiss conveniently neglects to talk about it or even mention it in passing. Can I get a little help here?
"C allows statements of the form
#include filename
which reads filename and inserts its contents in place of the include statement. Include statements may be nested; in other words, the file filename may itself contain an include statement, but, obviously, a file can't include itself in any chain. Write a program that reads in a file and outputs the file as modified by the include statements."
I don't even know where to begin on this. We didn't cover anything of this sort in Principles of CS I, and as seems to be the norm, Mr. Weiss conveniently neglects to talk about it or even mention it in passing. Can I get a little help here?