- #1
Dr.Brain
- 538
- 2
#include<stdio.h>
#include<conio.h>
class info
{
int name,roll;
public:
void input();
void output();
}
void info::input()
{
printf("Enter your name and rollno \n");
scanf("%c%d" ,&name,&roll);
}
void info:
utput()
{
printf("Your name is %c \n" ,name);
printf("Your rollno is &d \n" , roll);
}
class marks :public info
{
int math,bio,eng;
public:
void input();
void output();
}
void marks::input()
{
info::input() ;
printf("Input marks : \n");
scanf("%d%d%d" , &math , &bio , &eng);
}
void marks:
utput()
{
info:
uput();
printf("Your marks are %d %d %d \n" ,math,bio,eng);
}
void main()
{
clrscr();
class marks m;
m.input();
m.output();
getch();
}
---------------
I have darkened the line in which my compiler shows the error...i don't seem to find any ...
, it says "Declaration Syntax Error")
#include<conio.h>
class info
{
int name,roll;
public:
void input();
void output();
}
void info::input()
{
printf("Enter your name and rollno \n");
scanf("%c%d" ,&name,&roll);
}
void info:
{
printf("Your name is %c \n" ,name);
printf("Your rollno is &d \n" , roll);
}
class marks :public info
{
int math,bio,eng;
public:
void input();
void output();
}
void marks::input()
{
info::input() ;
printf("Input marks : \n");
scanf("%d%d%d" , &math , &bio , &eng);
}
void marks:
{
info:
printf("Your marks are %d %d %d \n" ,math,bio,eng);
}
void main()
{
clrscr();
class marks m;
m.input();
m.output();
getch();
}
---------------
I have darkened the line in which my compiler shows the error...i don't seem to find any ...
![Bug Eye :bugeye: :bugeye:](https://www.physicsforums.com/styles/physicsforums/xenforo/smilies/oldschool/bugeye.gif)