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:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
[quote][i]Originally posted by Mike Buess[/i] [br]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 [url="http://G.webring.com/go?ring=originwebring"]Origin WebRing[/url] Member [/quote]
Check here to include your profile signature.
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
Snitz Forums 2000