11-25-2004, 08:08 AM
|
#7 (permalink)
|
Ultra Techie Join Date: Jun 2004 Posts: 973
| DemonEdge, Quote:
1)
what is the difference between "void main()" and ur "void main(void)"?
| There is no difference between those statements. Both take no arguments and return no value. In the second one I guess, 'void' is used explicitly to specify null arguments. Quote:
2)what is the difference between "#include <iostream.h>"
and "#include <iostream>" without h?
| AFAIK always the header files ends with ' .h ' . The new version of C uses only the header name without a h and the old ones' you need to specify the .h with the header in the' include' statment. [ There is some difference , I forgot. Its something to do with the path of the header file, i guess :rolleyes: ] Quote: |
3)what does "using namespace std;" do?
| namespace are used to create collection of integers or floats or any other data types. In C++ header files, the data types are declared with the 'std' alias with the namespace.
So in older versions, you shld specify the functions as 'std.cin<<' , or 'std.cout>>' in the programs. Instead if you use 'using namepace std ' at the top of program , you dont need to define like 'std.cout<<' for the functions. You can just state as 'cout<<' .
For the new versions, you dont need to use the namespace anyz. |
| |