The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Passing arguments to string functions

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Mike Buess Posted - 05/27/2002 : 1:24:05 PM
What is the proper way to pass string and character arguments to an OriginC string function? For example,

int test(string str1="abcdef", char ch1='c')
{
return str1.Find( ch1 );
}

test()=;
test()=2 //as expected, but

test(abcdef,c)=;
test(ABCDEF,C)=6

This function returns the string length regardless of the arguments I use. What am I doing wrong?

Mike Buess
Origin WebRing Member
2   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 05/27/2002 : 8:26:23 PM
Thanks, CP.

Mike Buess
Origin WebRing Member
cpyang Posted - 05/27/2002 : 3:02:35 PM
test("abcdef", 'c')=;

You must indicate passing as character or as string to avoid confusion.

CP




Edited by - cpyang on 05/27/2002 15:04:35

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000