Sunday, July 4, 2010

PROGRAM TO COPY STRINGS USING POINTERS

Buzz It
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
char*s;
cout<<"enter the string\n";
gets(s);
char*p=" ";
cout<<"\nthe string "<<s<<" is in "<<&s<<"\n";
p=s;
cout<<"\ncopied to "<<&p<<"\nstring is\t"<<p<<"\n";
getch();
}


OUTPUT:
enter the string
farook
the string is in 0*8fcefff4
copied to 0*8fcefff2
string is farook

0 comments:

Post a Comment