Posts

Showing posts from February, 2013

Friend Function Using C++ Programming

#include<iostream.h> #include<conio.h> class  Ashish {     int a,b;    public:     void input()     {        cout<<"Enter two values:";        cin>>a>>b;     }     friend int info(Ashish ob); }; int info(Ashish ob) {    return int(ob.a+ob.b)/2; } void main() {     clrscr();     Ashish m;     m.input();     cout<<"\n value is : "<<info(m);     getch(); }           Output: Enter two values: 10, 20 Mean Value is: 15

Integer pointer to Character pointer type casting In C

WAP to Integer pointer to Character pointer type casting in C? #include<stdio.h> #include<conio.h> void main() {    clrscr(); int a=350,*p; char *c; p=&a; c=(char*)p; printf(" \t%d",*c); getch(); }