Xcode compile problem - basic c++

Hi guys,
I am new to c++, and I have been going through some basic code to get used to the syntax etc.
I have encountered a compiling issue with my current code. The purpose of this code is to convert feet and inches into meters and centimetres.

#include <iostream>
#include <cmath>

using namespace std;

int main ()

{
<<<xcode is saying I have an expected expression on this blank line>>>
double feet1, inch1, inch2, meter1, centimeter1;

cout << "Please enter a length in feet and inches " << endl;

cin >> feet1 >> inch1 >> ;

I have tried rewriting the #include through int main () expressions, I've tried copy/pasting the lines from other pieces of code... any ideas?
main should take the standard parameters for command-line arguments.
I'm sorry, can you rephrase the answer? I'm not sure what you mean. I was under the impression int main () was the same as int main (void) and would compile the same way.
Yes, int main() is the same as int main(void). However, that is not the correct signature for the main function. It should take the standard parameters for command-line arguments.
MikeyBoy wrote:
However, that is not the correct signature for the main function.
o_0

Revell13, did you copy and paste the code? it may be that you have a non-visible character in there.

Try: In the xcode menu look for Show Invisibles [under Editor(?)]. This should show your spaces as a dot any space that is a space would likely be you problem.
Last edited on
Since you're using XCode, are you sure you've created a C++ project and not an Objective-C project?

Have you posted your entire code because this doesn't look right:

cin >> feet1 >> inch1 >> ;
Topic archived. No new replies allowed.