473,666 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I keep getting syntax error that my coding is wrong...please help me ASAP!!!

1 New Member
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. using namespace std;
  3. void getLength();
  4. void getWidth();
  5. void getArea();
  6. void getdisplayData();
  7. int main()
  8. {
  9. // Get the rectangle's length.
  10. {
  11. double length;
  12. cout << "What is the rectangles length? ";
  13. cin >> length;
  14. // Get rectangles width.
  15. cout << "What is the rectangles width? ";
  16. cin >> width;
  17. }
  18. // Display the rectangle's data.
  19. {
  20. getdiplayData(getLength,getWidth, getArea);
  21. cout << "length = " << endl;
  22. cout << "width = " << endl;
  23. cout << "area = " << endl;
  24. }
  25. }
  26. return 0;
Oct 7 '13 #1
1 1326
Banfa
9,065 Recognized Expert Moderator Expert
You have the basic structure of your functions wrong, functions can not be defined inside other functions a program calling 1 function might look something like this

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void getLength();
  6.  
  7. int main()
  8. {
  9.   cout << "Main Entered" << endl;
  10.  
  11.   getLength();
  12.  
  13.   cout << "Back in Main, exiting now" << endl;
  14.  
  15.   return 0;
  16. }
  17.  
  18. void getLength()
  19. {
  20.   cout << "getLength called" << endl;
  21. }
  22.  
Oct 7 '13 #2

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

Similar topics

3
1466
by: Franko | last post by:
I get the following error. Ihave no idea why? Pl help Server Error in '/WebApplication1' Application. -------------------------------------------------------------------------------- Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0246: The type...
2
2109
by: David Hearn | last post by:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. SQLExpress database file auto-creation error: The connection string specifies a local SQL Server Express instance using a...
2
9286
by: Roy Rodsson via .NET 247 | last post by:
Hi all! I am using a stored procedure in SQL2000 for retrieving fileinformations from a db. the table as an uniqueidentifier for the file information. The stored procedure has a variable called fileIds that is oftype varchar. I am putting in a comma separated string with ids (such as:'9B176B0C-CA03-49C9-A2E7-063038E7CF20','9B176B0C-CA03-49C9-A2E7-063038E7CF22','9B176B0C-CA03-49C9-A2E7-063038E7CF23') However, when I execute the sp via...
3
1787
by: rich | last post by:
I keep getting the error: Warning: in_array(): Wrong datatype for second argument on line 679 here is the code. I declare and fill the array $specprimA = array(); $specprimA= getspecprim($dresstypeid); $primsecA=getprimsec(); Then I do a compare using in Array. I even put in the extra step of making sure I have something in the array with the is sizeof statement.
8
3679
by: Michael Press | last post by:
I have not written python codes nor run any. I saw this code posted and decided to try it. It fails. I read the tutorial and the entry for the built in function sum, but still do not see the problem. The code was cut and paste. Please help. Thanks. _________________________BEGIN_CODE_________________________ #!/usr/bin/python ps =
18
3774
by: rahuls | last post by:
Hi everyone, I have a couple of questions? 1.this is part of my main function ////////////////////////////// int main() { FILE *f1; int i,j; j=100000000; int intData;
7
2841
by: Yesurbius | last post by:
I am receiving the following error when attempting to run my query. In my mind - this error should not be happening - its a straight-forward query with a subquery. I am using Access 2003 with all the latest patches. If I do not group the query (ie. remove aggregation) it will work. If I recall, it also works if my subquery does not have joins. I want to accomplish this with pure SQL .. I could easily write a VBA function to handle...
7
14116
by: nhatto | last post by:
Hello I have Two Tables ( Table A and Table B) Table A has one field : email Table B has three Fields : First name, Last name , email I want to check if the email in Table B is found in Table A, And if it is , then I want to delete the row ( First name, Last name , email ) from Table B that has that email. any help is really appreciated and thank you in advance!
5
2164
by: hpailles | last post by:
I keep getting this error, could somebody help? <?php if ((!$_POST) || (isset($_GET)){ //haven't seen the form, so show it $display_block = " <form method=\"post\" action=\"".$_SERVER."\">
0
1426
by: dougancil | last post by:
I have the following code: Imports System.Data.SqlClient Public Class Main Protected WithEvents DataGridView1 As DataGridView Dim instForm2 As New Exceptions Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startpayrollButton.Click Dim ssql As String = "select MAX(payrolldate) AS , " & _ "dateadd(s, 518399, max(payrolldate)) AS " & _
0
8444
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.