This comes in two nice little packages. C++ and C.

C++:
Code:
#include <iostream>
using namespace std;

int main() {
//this is a variable to hold what the person typed
char mystring[255];
cout<<"Tell me something important: ";
cin>>mystring;
cout<<"You said "<<mystring<<"!"<<endl;
return 0;
}
C:
Code:
#include <stdio.h>

int main() {
/*this is the variable holding what the person typed*/
char mystring[255];
printf("Tell me something important: ");
scanf("%s", &mystring); /*no, that ampersand is not an accident*/
printf("You said %s!\n");
return 0;
}
EXPLAINATION -

C++:
First, I included the iostream file, which provides the basic set of input and output instructions for C++.
Then I included the namespace, std. Think of C++ as a binder. When you open this binder, you go to the "iostream" tab, and then to the "std" tab under "iostream". std contains the instructions for manipulating i/o streams.

I then initiate function main, the entry point of every program. It is an integer function, which means when it terminates, it returns an integer value to whatever called it (in this case DOS).
The variable "mystring" is created. Its type is character, and it is an array of 256 cells. That means that for every cell in this array, the type is character, and therefore when I have a bunch of characters lined up in an array, I form a string.
I then use the cout stream and shift the bytes (<<) to instruct it to output my question to the user's command prompt.
* I then use the cin stream, which is the input stream, and shift the bytes in the other direction (>>) indicating that I want the user to input something. The program will wait for the user to type something in and press enter, and will store whatever the user typed into mystring.
Then the cout stream again is shifted to tell the user what they input. Whatever happened to be input into the mystring variable is reguritated to the user.
I return 0, meaning that whatever program that handled this program (DOS) will be told "0". DOS doesn't do anything with this number, but it is good practice to include it.
I end the function main.

C:
I include the stdio.h file, which includes all the functions needed for input and output via the command line in C.
I initiate function main, which is the entry point of every program (all programs begin reading instructions at main).
Just like in the C++ program, I create an array of type character, 256 cells large (computers count from 0...so 255 is 255 counting from 1, what you are used to, but to the computer, 255 is 256 counting from 0).
When characters are placed into this array in order, they form a string, or a sentence, which means its a bunch of characters in order.
I use the output function printf() to ask the user for some input.
* I use the function scanf, which accepts two arguements.

THIS IS A REAL STICKY POINT - WHY DOES SCANF ACT THE WAY IT DOES?
scanf stands for scan formatted. It is used to read FORMATTED input, which means input written in a certain way.
When I call scanf, I must first tell it HOW I want it to interpret input, then where to store the input. The ampersand is important, because it is a pointer to the location of your variable - you can't just pass the variable directly.
So when I say
Code:
scanf("%s", &mystring);
I am really telling the computer that I want to read a raw string (%s stands for string) and store it at the memory location (&) of mystring.
What is formatting, you might say? Consider this...
Code:
scanf("FORMAT: %d %d %d %c", &myint1, &myint2, &myint3, &mychar1);
When you respond to this program, you must type into the command line (where 99 represents any number and c any character) exactly:

"FORMAT: 99 99 99 c"

And it will be read into the appropriate variables. It can easily be seen why this is useful (reading formatted files, for example).

In this case, I told scanf that I expect a string, and I want it to be stored in mystring.

Then I tell the computer to output a message using printf() again. Note the %s. You guessed it, %s, %d (a number), and %c (a single character) are shared between both scanf and printf. Note there is no & in front of my variable this time. This is because I am talking about the variable, not its address (in memory). The second thing I passed to the function was what variable I wanted printf() to replace the %s opcode with. Finally, \n is an escape sequence which means "newline", or simulate the pressing of enter on a computer (move down a line).

Finally, I return 0 to the handling program, and end the function main.

I know this is hard to understand...I'm not so good at explaining these concepts. If you didn't understand this, you should read some much better tutorials you can find floating on google and if you don't understand those, use this as a supplement.

It would be nice if someone rewrote this in a more -- newbie friendly way.