replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - How to pick a shorter substring out of a long string in SCC?
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to pick a shorter substring out of a long string in SCC?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Fri Nov 30, 2012 9:12 pm    Post subject: How to pick a shorter substring out of a long string in SCC? Reply with quote

If I have a string in a variable cline, whose value is "Now is the time for all good men", is there a way I can assign characters 7 thru 18 into another string variable, so the new (shorter) variable gets the value "the time for" ?

Is there a place where such functions are documented? I've found the functions whose names start with str easily enough, in the HELP section for SCC.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8254
Location: Salford, UK

PostPosted: Fri Nov 30, 2012 11:31 pm    Post subject: Reply with quote

strncpy
Back to top
View user's profile Send private message AIM Address
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Sat Dec 01, 2012 2:32 am    Post subject: Reply with quote

strncpy takes the FIRST characters found in a string, not characters from somewhere in the middle of the string, correct?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8254
Location: Salford, UK

PostPosted: Sat Dec 01, 2012 9:39 am    Post subject: Reply with quote

You can add an integer offset to the char* pointer in order to point to the first position from which to copy.

This will have to be my last post on this subject.
This is not really the place to get help with elementary programming.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
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