Vidyarthiplus (V+) - Indian Students Online Education Forum

Full Version: DEBUGGING C++ Contest - 25th August
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

This is a program in c++ which is implemented using some of the concepts of oops.Anyhow, it is not predicting the proper output.Hence, check whether there are some bugs and if you find any bugs clear it and repost the code with explanation.

  There are some bugs in the basic concepts of oops.Identify it and clear it.

Attachment your code here.
[attachment=8984]
#include<iostream.h>
#include<conio.h>
class a
{
private:
char name;
public:
void sample();
void welcome();
};
void a:Confusedample()
{
cout<<"THIS IS THE PROGRAM TO IMPLEMENT OOPS CONCEPTs";
}
void a::welcome()
{
cout<<"WELCOME TO OOPS";
}
class b
{
private:
char name1;
public:
void getdata()
{
cout<<"ENTER YOUR NAME";
cin>> name1;
}
void putdata()
{
cout<<"NAME="<<name1;
}
};
class c
{
private:
char name2;
name2=strcpy(name2,name1);
public:
void show data()
{
cout<<"NAME="<<name2;
}
};

In dis prgm , while acesing the member function outside the class syntax error.

Next, strcpy (name2,name1) is d crt one. bcs variable is initialised as name 2 .But in dis prgm it showed wrong syntax

Last one is class terminated incorrectly
I hve edited the program above
No main function in the Program and some basic errors in this programs are corrected The Debugged C++ program is here :[attachment=8987]
Pages: 1 2