To Add Own Header File in C++
"Nice One Program"
#include<iostream.h>
#include<conio.h>
#include"myfile.h"
void main()
{ clrscr();
int a=10,b=20;
int c=sum(a,b); //no prototype now create new file with extension .h
cout<<"Sum="<<c; //again error now include file using ""
getch();
}
FILE WITH .H Exntension Will Have
int sum(int x,int y)
{
return (x+y);
}
"Nice One Program"
#include<iostream.h>
#include<conio.h>
#include"myfile.h"
void main()
{ clrscr();
int a=10,b=20;
int c=sum(a,b); //no prototype now create new file with extension .h
cout<<"Sum="<<c; //again error now include file using ""
getch();
}
FILE WITH .H Exntension Will Have
int sum(int x,int y)
{
return (x+y);
}
No comments:
Post a Comment