121. Write a program to read and display using string pointer?

#include<iostream.h>
#include<conio.h>
void main()
{
                char *name;
                clrscr();
                cout<<"Enter Your Name : ";
                cin>>name;
                cout<<"\nEntered Name Is : "<<name;
                cout<<"\nSize of String Pointer : "<<sizeof(name);
                getch();
}

121

Advertisements

Comments are closed.

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: