#include<iostream.h>
void main()
{
class x
{
public:
int func(int)
{
cout<<"cool";
return 1;
}
}
}

Answer Posted / m.shanmuga sundaram,rjnsoftwar

An user defined data type should end with a semi colon
otherwise returns "error syntax error : missing ';'
before '}'"

#include<iostream.h>

void main()
{
class x
{
public:
int func(int)
{
cout<<"cool";
return 1;
}
} ; /*An user defined data type should end with a
semi colon*/
}

Is This Answer Correct ?    13 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we access protected and private members of a class?

583


an operation between an integer and real always yeilds a) integer result b) real result c) float result

702


Differentiate between a constructor and a destructor in c++.

558


Is map ordered c++?

585


What is pointer -to-members in C++? Give their syntax?

593






What is the purpose of templates in c++?

562


What is the difference between *p++ and (*p)++ ?

766


What is a virtual destructor? Explain the use of it?

541


Can I create my own functions in c++?

590


Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.

2088


What is implicit conversion/coercion in c++?

643


Where is atoi defined?

574


What does it mean to declare a member function as static?

605


How do I make turbo c++ full screen?

579


What does extern mean in a function declaration in c++?

695