473,406 Members | 2,404 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,406 software developers and data experts.

c++ compile errors

With the following block of code, I get the error message "Expected initializer before 'void'.

#include <iostream>

void Add( int add1, int add2)
void Sub( int sub1, int sub2)
void Mlt( int mlt1, int mlt2)
void Div( int div1, div2)

but I only get the error in the line declaring the Sub function. HELP!
Dec 27 '11 #1
6 2046
weaknessforcats
9,208 Expert Mod 8TB
You are missing semi-colons at the ends of the statements.
Dec 27 '11 #2
YOU are missing the using namespace std; statement if you work in visual c++ .
Dec 31 '11 #3
weaknessforcats
9,208 Expert Mod 8TB
using namespace std; is part of C++ and has nothing to do with using Visual C++. Plus, the code posted would not require this statement.
Dec 31 '11 #4
Expand|Select|Wrap|Line Numbers
  1. void Add( int add1, int add2)
  2. void Sub( int sub1, int sub2)
  3. void Mlt( int mlt1, int mlt2)
  4. void Div( int div1, div2) <---  int div2
You are missing
Expand|Select|Wrap|Line Numbers
  1. int div2
in
Expand|Select|Wrap|Line Numbers
  1. void Div( int div1, div2) 
Jan 1 '12 #5
weaknessforcats
9,208 Expert Mod 8TB
Did you read my post #2?
Jan 1 '12 #6
lspxy
12
Expand|Select|Wrap|Line Numbers
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. void Add( int add1, int add2);
  6. void Sub( int sub1, int sub2);
  7. void Mlt( int mlt1, int mlt2);
  8. void Div( int div1, int div2);
  9.  
Jan 2 '12 #7

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

Similar topics

1
by: Ravi Chaudhary | last post by:
Hi, We are using VS.Net 2003 and coding in VB.net. The solution has 38 projects; most of the projects in the solution reference other projects (without any circular references) and all the...
3
by: Carl Youngblood | last post by:
I recognize that I may not be giving sufficient information with this, but in the interest of not bogging the list down with too much code, I'll try and post just a little information and then if...
3
by: arthur-e | last post by:
A new Machine was set up by our IS department - it came with Office Pro 2003. Access97, Word97 and Excel 97 were added. I'm trying to update an Access 97database to 2003 but get weird compiling...
1
by: Ray Wampler | last post by:
According to the information on the Microsoft web site, code written in VB.NET 2002 can simply be recompiled using VS.NET 2003. However, I have found that code which compiles cleanly in VS.Net...
1
by: Ravi Chaudhary | last post by:
Hi, We are using VS.Net 2003 and coding in VB.net. The solution has 38 projects; most of the projects in the solution reference other projects (without any circular references) and all the...
2
by: donkeyboy | last post by:
All, I've tried the jythonc compiler to try and create an applet to see how it works, but I get a number of Java compile errors that are way above my knowledge. Does anyone know what any of the...
1
by: John Dalberg | last post by:
I converted a working web site project to a web application project and I am getting a bunch of warnings and compile errors. All code using .NET's profile class is giving an error. example...
1
by: =?Utf-8?B?SG93YXJkIFBpbnNsZXk=?= | last post by:
I'm trying to convert a Web Site to the Web Application project model and I'm running into compile errors that do not seem to be covered by the guidance I found at "Converting a Web Site Project to...
8
by: bradyounie | last post by:
I have a C++ COM project that was created with Visual C++ 6. I have just converted the project to Visual Studio 2005 and have been trying to build it. I get the following compile errors: warning...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.