#include <iostream.h>

void main()
{
   char line[25];
   cout << " Type a line terminated by carriage return\n>";
   cin.get( line, 25 );
   cout << ' ' << line;
}

I am new to this forum and also C++
I want a help with cin.getline() function..

As you see the two codes above both use the getline() function.

The thing is that in the big code getline is not putting any string into "name".
when i choice is selected it just jumps to the next one. :(

can anyone suggest any solution and a reason for this.

n00b.

Put cin.ignore() after each getline.

Replace all char arrays with, std::string, and replace all cin.getline with,
getline(cin,stringVariable);

Try this:

// DaniWeb Quicktest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <conio.h> //Use _getch() to pause the screen and not exit the program
#include <string>
using namespace std;

 
void main()
{
   char line[25];
   cout << " Type a line terminated by carriage return\n>";
   cin.getline( line, 25 ); //Your text was cin.get( line, 25 ) but modified to cin.getline( line, 25 )
   cout << line << endl;
   _getch(); //Taken from <conio.h> to pause program at end.
}

The Output should look like:

Type a line terminated by carriage return
>Hellooooo World!
Hellooooo World!

Hope this helped!