FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fundamentals: Get a number... (uses scanf) compile error

 
Post new topic   Reply to topic     Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
otto9otto



Joined: 02 Jan 2007
Posts: 2

PostPosted: Fri Jan 05, 2007 1:32 pm    Post subject: Fundamentals: Get a number... (uses scanf) compile error Reply with quote

I get the following errors trying to compile the Get a number from the user (uses scanf) on DMD 1.00:

dfile7.d(8): found ';' when expecting ','
dfile7.d(8): expression expected, not ')'
dfile7.d(8): found ';' when expecting ','
dfile7.d(10): found ';' when expecting ','
dfile7.d(11): expression expected, not 'return'
dfile7.d(11): found '0' when expecting ','
dfile7.d(11): expression expected, not ';'
dfile7.d(12): found '}' when expecting ','
dfile7.d(12): expression expected, not 'EOF'
dfile7.d(12): found 'EOF' when expecting ','
dfile7.d(12): expression expected, not 'EOF'
dfile7.d(12): found 'EOF' when expecting ','
dfile7.d(12): expression expected, not 'EOF'
dfile7.d(12): found 'EOF' when expecting ','
dfile7.d(12): expression expected, not 'EOF'
dfile7.d(12): found 'EOF' when expecting ','
dfile7.d(12): expression expected, not 'EOF'
dfile7.d(12): found 'EOF' when expecting ','
dfile7.d(12): expression expected, not 'EOF'
dfile7.d(12): found 'EOF' when expecting ','
dfile7.d(12): expression expected, not 'EOF'
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Fri Jan 05, 2007 2:13 pm    Post subject: Reply with quote

I found the problem and fixed it.

In the example,
Code:
scanf("?lf", &n;);
should be
Code:
scanf("?lf", &n);

The troublesome extra semi-colon was caused by some kind of bug in the HTMLization process. I worked-around the problem by adding a space between the ampersand and the n. It doesn't look quite as nice as without the space, but the compiler likes it fine.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group