473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

The line of Constructor is showing an error

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. using namespace std;
  3. class qwerty{
  4.  
  5.     public:
  6.     qwerty();
  7.     void dispalymessage(){
  8.         cout<<"Welcome to the world of Programming"<<endl; 
  9.     }
  10. };
  11. int main(){
  12.     qwerty avinash;
  13.     avinash.dispalymessage();
  14.  
  15. }
why am i getting an error in the qwerty() line when i run the program?if i remove qwerty() then the program is runing fine...y this is happening so?
Mar 17 '14 #1
2 1117
oh..i got it...the error is that i have kept a semicolon after qwerty()...now i am getting the right answer...Thank u
Mar 17 '14 #2
weaknessforcats
9,208 Expert Mod 8TB
The qwerty constructor has no definition. That is, no code for it.

BTW: Avoid defining your functions inside the class declaration. This creates a thing called an in-line function which a) bloats your program executable, and b) prevents you from using polymorphism with this class. Unless you know what you are doing, member functions need to be coded outside the class.
Mar 17 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Lloyd Sheen | last post by:
Is there a setting in VS2003 to ensure that when debugging a page it will stop on all errors. At present it just displays a page with the error but I want it to stop at that line when the error...
4
by: Tom Kaminski [MVP] | last post by:
I'm 99% sure I used to see a line number referenced in my ASP.NET error messages but sometime over the last couple of weeks the error messages no longer reference one. Am I imagining things or...
0
by: jonathan184 | last post by:
This is part of the perl script. Basically i want to try and get the second line of the error message. Now the whole error which is 5 lines long will come up if i use $Errormsg So basically i...
1
by: nRk | last post by:
Hi, I am working on asp.net 2.0 with Visual Studio 2005. My asp.net project contains one Masterpage. I exposed my asp.net project in my machine (Windows XP with IIS 5.1) and access using...
4
pradeepjain
by: pradeepjain | last post by:
Hii ..i am a lamp professional!! i use javascript for validation purposes! but sometimes javascript stops working bcos of errors!!and i find it difficult to find those errors! is there any log for...
1
by: hamid faisal | last post by:
Sir/Madam, I am using vb6. I had my project with MS-Acess DB & DAO. Now I convertedd it fully to ADODC in same vb6. Its upon execution, showing error "Unable to bind to field or DataMember...
0
by: KarthikaKKD | last post by:
Im passing table name & column name which im selecting from cursor.But its inserting correctly and also showing error like cursor is not open . my proc is as: CREATE OR REPLACE PROCEDURE...
2
by: yxzhang | last post by:
I have a problem to start Boa Constructor. The error message is: C:\Python26>c:\python26\python.exe C:\Python26\Lib\site-packages\boa-constructor\boa.py Starting Boa Constructor v0.6.1 importing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.