Showing posts with label Coding Of GET PUT Function In C. Show all posts
Showing posts with label Coding Of GET PUT Function In C. Show all posts

Wednesday, 31 October 2012

Program Of Unary Operator Overloading In C++

#include<iostream.h>
#include<conio.h>
 
{
 
    private:
 
    int a;
 
    public:
  
  void getdata(int x)
 
    {
 
      a= x;   
 
    }
  
    {
 
    a++;
 
    }
 
    void display()
 
    {
     
 cout<<"\n a="<<a;   
 
    }
 
}
 
main()
 
{
 
clrscr();
 
box b1;
 
int x;
 
cout<<"Enter x=";
 
cin>>x;
 
++b1;
 
++b1;
 
++b1;
 
++b1;
 
getch();
 
}

Monday, 29 October 2012

Program Of GET PUT Function In C

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
 
main()
 
{
 
clrscr();
 
int i,a,m,n;
 
printf("Enter No. Of Char");
 
scanf("%d",&m);
 
printf("\n Contens Of Main File=");
 
for(i=1;i<=m;i++)
 
{
 
scanf("%d",&n);
 
if(n==-1)
 
break;
 
}
 
fclose(f1);
 
f1=fopen("Main","r");
 
f2=fopen("ODD","w");
 
f3=fopen("EVEN","w");
 
while(a!=EOF)
 
{
 
if(a%2==0)
 
{
 
}
 
else
 
{
putw(a,f2);
 
}
 
a=getw(f1);
 

fclose(f1);
 
fclose(f2);
 
fclose(f3);
 
f2=fopen("ODD","r");
 
f3=fopen("EVEN","r");
 
printf("Content of ODD File \n");
 

{
 
printf("%d\n",a);
 
}
 
printf("Content Of Even File\n ");
 
while(a=getw(f3)!=EOF)
 
{
 
printf("%d\n",a);
 
}
 
fclose(f2);
 
fclose(f3);
 
getch();
 
}