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 support@ccsinfo.com

Send string to function as parameter

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



Joined: 29 Mar 2008
Posts: 26
Location: Ribeirão Preto, SP, Brasil

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

Send string to function as parameter
PostPosted: Sun Jul 27, 2008 12:37 am     Reply with quote

Hi. This is possible in CCS?

I need to send a string to my custom function in CCS, but i don't know how.

Creating a function like lcd_putc and calling like " printf(lcd_putc,'test'); " doesn't work because printf will call 'lcd_putc' 4 times, one for each char and i need to call the function only one.

PS: currently, i'm using a global variable (char[50]) to pass the string, so i need this code to work:


Code:
strcpy(var,"test");
MyFunction();


So, in my function i work with 'var' to get the text. I would like to simple call:
Code:
MyFunc('test');
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 27, 2008 1:06 am     Reply with quote

Quote:
I need to send a string to my custom function in CCS, but i don't know how.

http://www.ccsinfo.com/forum/viewtopic.php?t=35436
jmaurin



Joined: 29 Mar 2008
Posts: 26
Location: Ribeirão Preto, SP, Brasil

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

PostPosted: Sun Jul 27, 2008 8:31 pm     Reply with quote

thank you!
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