#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
How can we access protected and private members of a class?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
Differentiate between a constructor and a destructor in c++.
Is map ordered c++?
What is pointer -to-members in C++? Give their syntax?
What is the purpose of templates in c++?
What is the difference between *p++ and (*p)++ ?
What is a virtual destructor? Explain the use of it?
Can I create my own functions in c++?
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.
What is implicit conversion/coercion in c++?
Where is atoi defined?
What does it mean to declare a member function as static?
How do I make turbo c++ full screen?
What does extern mean in a function declaration in c++?