Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

Simple Error in C++ Code


Hi.  What's wrong with this?  Thanks!

NOTE: "finish" and "now" are doubles supplied to the function

/******* CODE ****************/

double minarr;
minarr = 2;

if minarr >= ((finish - now) / 365)                        
{
//some code here
}

/******* ERROR ***************/

D:\test\test.cpp(664) : error C2061: syntax error : identifier 'minarr'
D:\test\test.cpp(665) : error C2143: syntax error : missing ';' before '{'

/****************************/
0
malramsay
Asked:
malramsay
1 Solution
 
tinchosCommented:
Hi malramsay,

you're missing the () that encloses the condition

try with this


double minarr;
minarr = 2;

if( minarr >= ((finish - now) / 365) )
{
//some code here
}

Cheers!
Tincho
0
 
malramsayAuthor Commented:

Thanks Tincho.  I knew it would be easy!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now