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

Passing variable to functions

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



Joined: 25 Nov 2005
Posts: 56
Location: Porto - Portugal

View user's profile Send private message Visit poster's website

Passing variable to functions
PostPosted: Thu Dec 28, 2006 9:20 am     Reply with quote

Hello

I have a table like this

f1, 1, 1
f2, 3, 2
f3, 5, 3
f4, 7 ,4

where in each line the first data will be a pin and the others will be int8.
I have to pass every line each time to a function like this:
Code:

void read(char c, int x, int nr)
{
if(input('c'))
   {
   lcd_gotoxy(x,2);
   lcd_putc("nr");
   }
}


the calling for this function maybe...
Code:

void findit(char c, int8 x, int8 nr);


but i cannot write the code to each time a send a line like this f1,1,1 and then next time f2,3,2 etc

any help?

Thanks a lot

Jaime
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Dec 28, 2006 1:49 pm     Reply with quote

Here are functions to do pin i/o, with the pin number passed as
a variable:

For 16F:
http://www.ccsinfo.com/forum/viewtopic.php?t=25280&start=4

For 18F:
http://www.ccsinfo.com/forum/viewtopic.php?t=27723&start=3
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