Please someone could guide me with the difference between cin,gets,getline and cout,puts,write.Especially cout and puts gives the same output then how are they different?????
1 - puts is an ANSI C function defined in the <stdio.h> header
2 - cout is not a function: it's a stream, associated to a file. When you do something like:
cout << "Hello" << endl;
You are using operator << (operator 'send to', which is a function, but written in C++, so unlike puts, it's Object-Oriented) : you are sending the string "Hello" to the stream cout, which is analogous to C's stdout.
3 - Same for getline and cin, except that getline is redefined in C++'s <iostream> header, so you need to be careful.
If you need to do basic I/O in C++, check this site, I found it very useful:
www.cppreference.com