Jump to content

Recommended Posts

Please can anyone tell me why this code wont work?

 

 

 

void main ()

{

char x,y;

x=4;

y=2;

x=x/y;

}

 

 

failure

C:\Documents and Settings\Administrator\Desktop\test2\test.c(32:4): error: failed to generate expression

C:\Documents and Settings\Administrator\Desktop\test2\test.c(32:4): error: invalid operand '/'

C:\Documents and Settings\Administrator\Desktop\test2\test.c(32:2): error: failed to generate expression

 

Thank you.

Link to post
Share on other sites

Internet,

 

You didn't add the system include:

 

#include<system.h>

void main ()
{
   char x,y;
   x=4;
   y=2;
   x=x/y;
}

 

Regards

Dave

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...