473,395 Members | 1,368 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,395 software developers and data experts.

I keep getting a declaration syntax error...Can anyone help?

//remain.cpp

#include <iostream.h>
#include <conio.h>



int main()
getline ()

{

int beef = 2;
int ham = 3;
int turkey = 4;
int american = 5;
int swiss = 6;
int lettuce = 7;
int tomatoe = 8;
int pickle = 2;
int mayo = 1;
int meat;
int cheese;
int fixings;
int total;


cout << "What type of meat do you want (choose one)?\n";
cout << "beef\n";
cout << "ham\n";
cout << "turkey\n";
getline(cin, meat);

cout << "What type of cheese do you want (choose one)?\n";
cout << "american\n";
cout << "swiss\n";
getline(cin, cheese);

cout << "What fixings do you want (choose all if wanted)?\n";
cout << "lettuce\n";
cout << "tomatoe\n";
cout << "pickle\n";
cout << "mayo\n";
getline(cin, fixings);

meat = turkey + ham + beef;
cheese = american + swiss;
fixings = lettuce + tomatoe + pickle + mayo;
total = meat + cheese + fixings;

cout << "Your total cost is " << total;

getch();

return 0;

}
Oct 19 '06 #1
2 3957
vermarajeev
180 100+
I'm unable to understand what r u trying to do with your code....

Firstly, could you please tell me what do you mean when you write

int main()
getline ()
{
return 0;
}

If you are able to reply me correctly, I'm sure you will fix that problem yourself...

Thankx
Oct 19 '06 #2
tyreld
144 100+
Remove the getline between main and the first bracket.

Expand|Select|Wrap|Line Numbers
  1. int main()
  2. {
  3. ...
  4. }
  5.  
  6. INSTEAD OF
  7.  
  8. int main()
  9.  
  10. getline()
  11. {
  12. ...
  13. }
  14.  
Oct 19 '06 #3

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

Similar topics

83
by: Alexander Zatvornitskiy | last post by:
Hello All! I'am novice in python, and I find one very bad thing (from my point of view) in language. There is no keyword or syntax to declare variable, like 'var' in Pascal, or special syntax in...
16
by: Bhushit Joshipura | last post by:
This post contains one question and one proposal. A. May I know why order of evaluation of arguments is not specified in C/C++? I asked a question in comp.lang.c++ for the following...
3
by: Wild Wind | last post by:
Hello, I made a post relating to this issue a while back, but I haven't received any answer, so here I am again. I am writing a mixed C++ dll which uses the following declaration: typedef...
1
by: pai | last post by:
#include<iostream.h> struct ab{ int a; }; template <class T> class A{ struct ab * ret_1();
2
by: coolindienc | last post by:
Today I am going nuts. This is another one that is not working. It keeps giving me syntax error at highlighted line. No matter what I do I still have that error at the same line. It seems that my...
6
by: Hunk | last post by:
Hi I have a question on usage of forward declarations of templates. While searching through this group , people suggested using forward declarations and typedefs for templates as // in...
10
by: fred.zakity | last post by:
Can someone please explain this function pointer declaration: float (* getptr (char opcode) ) (int, int); I'm confused by the syntax - I have not seen a function pointer with the extra...
8
by: illuzion | last post by:
ok I keep getting this error: Parse error: syntax error, unexpected T_VARIABLE in /home/illuzion/public_html/BAMF/contactus.php on line 38 and this error is possibly on other lines could...
10
by: charmeda103 | last post by:
My program keeps getting me and error and i dont why here is the error message error C2061: syntax error: identifier 'infile' error C2660: 'ReadDate' : function does not take 6 arguments...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
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: 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
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.