S
Schizoid Man
Hi,
I'm a novice whose just about migrating to C++ after cutting my teeth on
C for a few years.
To start with I'm using Microsoft's out-of-the-box Visual C++ Express
Edition compiler and I had a couple of questions:
1. If I am using namespace std, is there a specific reason for me to
place std:: before all the manipulators - cout, endl, etc? I've noticed
that without the std:: prefix, all the methods work as expected.
2. I've been skimming Deitel's How to Program in C++ and noticed
something very strange. In the chapter on functions, the author's code
contains the function method AFTER the main() method, even though the
main() method calls the function. This would throw a compile error in C,
so is this valid syntax in C++?
3. Another question about bridging C and C++: I do know that an implicit
conversion from void* to double* is completely legal in C, but (so I'm
told) illegal in C++. Is there a reason for the latter?
Thanks in advance,
Schiz
I'm a novice whose just about migrating to C++ after cutting my teeth on
C for a few years.
To start with I'm using Microsoft's out-of-the-box Visual C++ Express
Edition compiler and I had a couple of questions:
1. If I am using namespace std, is there a specific reason for me to
place std:: before all the manipulators - cout, endl, etc? I've noticed
that without the std:: prefix, all the methods work as expected.
2. I've been skimming Deitel's How to Program in C++ and noticed
something very strange. In the chapter on functions, the author's code
contains the function method AFTER the main() method, even though the
main() method calls the function. This would throw a compile error in C,
so is this valid syntax in C++?
3. Another question about bridging C and C++: I do know that an implicit
conversion from void* to double* is completely legal in C, but (so I'm
told) illegal in C++. Is there a reason for the latter?
Thanks in advance,
Schiz