Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Funticon error

Status
Not open for further replies.

villica

Programmer
Feb 25, 2000
332
CA
I have the following in one of my header files.<br>
bool GetLicense(char szLicense[]) const;<br>
<br>
In my cpp file I have the following:<br>
<br>
bFullLot = m_aRentalCars[m_nCurrentCarCount].SetLicense(RentalCar.GetLicense(char szLicense[])const;<br>
<br>
I am getting the following error<br>
<br>
error C2144: syntax error : missing ')' before type 'char'<br>
<br>
error C2660: 'GetLicense' : function does not take 0 parameters<br>
<br>
<br>
Any ideas what is asking for <p>Villica<br><a href=mailto:villica67@hotmail.com>villica67@hotmail.com</a><br><a href= > </a><br>
 
Your syntax error is because you need a closing parenthesis to close the SetLicense call.<br>
<br>
bFullLot = m_aRentalCars[m_nCurrentCarCount].SetLicense(RentalCar.GetLicense(char szLicense[])const);<br>
^<br>
I am getting the following error<br>
<br>
error C2144: syntax error : missing ')' before type 'char'<br>
<br>
<p>Pat Gleason<br><a href=mailto:gleason@megsinet.net>gleason@megsinet.net</a><br><a href= > </a><br>
 
Thank you for your response I tried it and I still get the same error. <p>Villica<br><a href=mailto:villica67@hotmail.com>villica67@hotmail.com</a><br><a href= > </a><br>
 
bool GetLicense(char szLicense[]) const;<br>
<br>
bFullLot = m_aRentalCars[m_nCurrentCarCount].SetLicense(RentalCar.GetLicense(char szLicense[])const;<br>
<br>
<br>
error C2144: syntax error : missing ')' before type 'char'<br>
<br>
this error means that the editor is not recognizing szLicense[] as a variable. <br>
<br>
<br>
<br>
error C2660: 'GetLicense' : function does not take 0 parameters<br>
<br>
<br>
The GetLicense() is defined to pass a char variable and since the editor is not recognizing szLicense[] as a variable this error results.<br>
<br>
<br>
If szLicense is already declared as a char variable then there is no need to have char before szLicense[], or the const at the end. also there is no closing ) for the SetLicense call. Try taking these out and closing that call and see what you get? What is szLicense[] a variable a call or what? what is the [] for?<br>
<br>
<br>
<br>

 
Hey why&nbsp;&nbsp;in the second statement you are actually calling the function GetLicense. Therefore as mentioned by clay you don't need to declare szLicense as a char variable. Just remove the char and [] brackets.<br><br>I think this would help<br>Siddhartha Singh<br><A HREF="mailto:ssingh@aztecsoft.com">ssingh@aztecsoft.com</A>
 
Thank all of you for your help.&nbsp;&nbsp;It makes sense. <br>I will try to remove the char and the variable and see it it works.<br>The reason I have in there is because in the header file is writtent the following way so I assume that when you call it you do it the same way.<br><br>bool GetLicense(char szLicense[]) const<br><br> <p>Villica<br><a href=mailto:villica67@hotmail.com>villica67@hotmail.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top