CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Compiler error

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lilayta



Joined: 26 Feb 2004
Posts: 3

View user's profile Send private message

Compiler error
PostPosted: Mon Mar 01, 2004 5:49 am     Reply with quote

Hello,
Iam making a division between two integers numbers , and Iam using the structure div_t. The problem is , the compiler always give me the same error :" expecting a variable"
The goal of the program is to select the hundred, tens of units of a decimal number, to put onto 3 displays of 7 segments.
The code of the visualization is not represented here.

I don't know if faults me some instruccion or if something in my code is wrong. Here it is my code:

#include <16f877.h>
#include <string.h>
#include <stdlib.h>

...
main()
{
...

div_t x;
x=div(grados,100);
centenas = x.quot;
num1 = x.rem;

x=div(num1,10);
decenas = x.quot;
unidades=x.rem;
...
Al



Joined: 13 Nov 2003
Posts: 28
Location: Belfast

View user's profile Send private message

PostPosted: Mon Mar 01, 2004 6:33 am     Reply with quote

Are you sure this is where your problem lies? It compiles fine for me. I don't know what you have declared your variables as, but I declred them as ints.

int grados, centenas, num1, decenas, unidades;


What complier are you using?
_________________
Alan Murray
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion 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