Help me out , This code only print First part till white Space For example if i give Input "Jhon Kane"
the it only prints "jhon" kindly help me with some code which print the whole Name

#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
main()
{
      char *c;
      c=new char[20];
      cout<<"please Enetr the string :";
      cin>>c;     
      cout<<"string is  : ";
      for(; *c!='\0'; c++)
      {
      cout<<*c;
      }
      getch();
      }

Try cin.getline

1) This is not a code snippet, so why are you posting it as one.
2) cin >> extract only disregards white spaces so when the input is
john kane, for your "c" variable, it only contains john.

3) Use getline.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.