|
|
char name[20]; void displayn() { cout<<"Name :"<<name<<endl; } void setn(char *c) { strcpy(name,c); } char getn() { return *name; } int main() { char result[20]; char p[20]="sharan"; displayn(); setn(p); displayn(); cout<<getn()<<endl; strcpy(result,name); cout<<result<<endl; getch(); } |
|
|