LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-07-2004, 03:02 AM   #1
xxfunkxx
LQ Newbie
 
Registered: Jul 2004
Location: Vienna
Distribution: Debian Sid
Posts: 26

Rep: Reputation: 15
Cannot find strnset() in string.h: none ANSI-C function


Hello!
I want to make use of the function strnset() which I found explained on many webpages. They all include the string.h but on my machine (Debian Sid) I don`t have this function in my string.h
Thats why I get a linker error: undefined reference to 'strnset'.


Does anyone know where do I get this non ANSI-C function?

xxfunkxx
 
Old 12-07-2004, 04:44 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
This appears to be a function provided by the QNX operating system, and is also found in Borland's Turbo C.

If you're not worried about supporting Unicode, UTF-8 or other double-byte character sets, you can just use memset and pass it the same arguments.

The only difference between the two is that memset allows you to put characters that are more than one byte long into a string; libc currently doesn't support multi-byte characters (someone please correct me if I'm wrong!) so you won't find an efficient strnset function on GNU/Linux (yet).
 
Old 12-09-2004, 09:18 AM   #3
xxfunkxx
LQ Newbie
 
Registered: Jul 2004
Location: Vienna
Distribution: Debian Sid
Posts: 26

Original Poster
Rep: Reputation: 15
memset() did work

thank you

xxfunkxx
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can a function return a string? hubabuba Programming 13 03-06-2005 02:51 PM
passing php string to javascript function djgerbavore Programming 2 03-01-2005 11:34 AM
optimize PHP string function Cedrik Programming 6 08-29-2004 09:07 AM
Hash-Function (string to int) Hady Programming 5 04-05-2004 01:53 AM
passing a string to a function jkobrien Programming 8 11-05-2003 01:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration