The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What the command to find out the record length of a fixed length file? tranq01 UNIX for Dummies Questions & Answers 9 12-04-2008 04:04 PM
ksh: Comparing strings that contain spaces and working with substrings nancylt723 Shell Programming and Scripting 2 02-19-2008 03:01 PM
Breaking strings into Substrings switch Shell Programming and Scripting 4 04-06-2006 04:29 AM
Sed working on lines of small length and not large length thanuman UNIX for Dummies Questions & Answers 3 04-15-2005 06:12 AM
creating a fixed length output from a variable length input r1500 Shell Programming and Scripting 2 12-03-2003 01:09 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-17-2002
Vishnu Vishnu is offline
Registered User
  
 

Join Date: Aug 2002
Location: Marlboro, MA
Posts: 114
Accessing substrings by offset and length

Hi,

I have a simple question... In C do we have a standard library function which will return the pointer to a substring at certain offset and having certain length...

Ofcourse we should take care not to access beyond allocated length in the parent string and don't overwrite beyond allocated length in the destination string...

it may look like this

int foo (char *s, char *t, int offset, int length);

if *s = "vishnu"; offset = 3; length = 2; it should give back
*t = "sh"

I'm not saying I want a function with the exact interface as above, but anything which allows me to access substrings by offset and length would be great...

This is not a homework question!!! I work in an office and write small C programs and sh scripts to automate task in a UNIX environment..

Thank you!
Vishnu.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0