arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Explaining your first program! [C++]
#3
(10-01-2015, 09:59 AM)Rishabh-Jain Wrote: it is a great effort by you.  i appreciate it very much,
i would like to add something in your tutorial.
1st) I think you should include the full header file as this is a beginners  level tutorial
#include <iostream.h>

2nd) use the main function as void main() instead of int main() because the users might get error if they forgot to return an int. or even worse if they don't realize that they only have to return int. for a function defined as int type

3rd) Please include the importance of  "<<" in cout << "Hello, anon!" << endl; that why it "<<" not ">>"

OSM WORK

Best Regard

int main is what is most used in C++ examples from what I have seen. I also use int main since I need to return 1 when there are errors. (or exit(-1))

It's also common sense that if "<<" is the one in the example, then it is the correct one. And that ">>" would be a different one. Like how "and" and "end" sounds alike but is totally different.
http://FreeVPS.club - Free VPSs!
lockThread Closed 


Messages In This Thread
Explaining your first program! [C++] - by paronte - 10-01-2015, 04:09 AM
RE: Explaining your first program! [C++] - by Conan - 10-03-2015, 06:16 PM

Possibly Related Threads…
Thread
Author
Replies
Views
Last Post

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting