473,805 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strsep() function Problem, please help

Hi everyone,

I'm trying to get this program compiled under Solaris. I have actually
no idea about programming, sorry to bother you.

Unfortunately Solaris don't use the function strsep() anymore:
char *strsep(char **stringp, const char *delim);

DESCRIPTION
The strsep() function returns the next token from the
string stringp which is delimited by delim. The token is
terminated with a `\0' character and stringp is updated to
point past the token.

RETURN VALUE
The strsep() function returns a pointer to the token, or
NULL if delim is not found in stringp.

I need to use a function that Solaris knows about. Tried to simply
substitute strsep() with strtok() which didn't work. The string which I
need to port is:

while (fgets(buf, sizeof(buf), desc) != NULL) {
w = buf;
if ((p = strsep(&w, " \t")) == NULL)
continue;
..
..
..
Any help would be greatly appreciated since google and everyone I know
couldn't help.

-Dan

Jul 23 '05 #1
2 6489
da****@best.de wrote:
I'm trying to get this program compiled under Solaris. I have actually
no idea about programming, sorry to bother you.

Unfortunately Solaris don't use the function strsep() anymore:
char *strsep(char **stringp, const char *delim);

DESCRIPTION
The strsep() function returns the next token from the
string stringp which is delimited by delim. The token is
terminated with a `\0' character and stringp is updated to
point past the token.

RETURN VALUE
The strsep() function returns a pointer to the token, or
NULL if delim is not found in stringp.

I need to use a function that Solaris knows about. Tried to simply
substitute strsep() with strtok() which didn't work. The string which I
need to port is:

while (fgets(buf, sizeof(buf), desc) != NULL) {
w = buf;
if ((p = strsep(&w, " \t")) == NULL)
continue;


If I remember correctly (and you can verify it by RTFMing), separation
of the string is usually done by _repeated_ calls to 'strtok' and passing
NULL as the first argument on the second and the subsequent calls, until
it returns NULL. That is definitely different from 'strsep' as it is
specified in your post. So, replacing 'strsep' with 'strtok' won't work.

Your question seems to be rather of the C sort, and, since there is no
standard 'strsep' function (i.e. it's platform-specific) you should maybe
ask in a C newsgroup or in the Solaris newsgroup...

I would recommend using 'std::string' and its member function 'substr',
but if you 'have actually no idea about programming', you should perhaps
find somebody who does and hire him/her...

V
Jul 23 '05 #2

<da****@best.de > wrote in message news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
Hi everyone,

I'm trying to get this program compiled under Solaris. I have actually
no idea about programming, sorry to bother you.

Unfortunately Solaris don't use the function strsep() anymore:
char *strsep(char **stringp, const char *delim);

DESCRIPTION
The strsep() function returns the next token from the
string stringp which is delimited by delim. The token is
terminated with a `\0' character and stringp is updated to
point past the token.

RETURN VALUE
The strsep() function returns a pointer to the token, or
NULL if delim is not found in stringp.

I need to use a function that Solaris knows about. Tried to simply
substitute strsep() with strtok() which didn't work. The string which I
need to port is:

while (fgets(buf, sizeof(buf), desc) != NULL) {
w = buf;
if ((p = strsep(&w, " \t")) == NULL)
continue;
.
.
.
Any help would be greatly appreciated since google and everyone I know
couldn't help.

-Dan


You can use C++ features instead of strsep().
Look at http://groups-beta.google.com/group/...3a5c6335?hl=en
--
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3767
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class (ClassB* b; b->func(); ) the base-class function is called instead of the new function in the derived class. All other similar functions (virtual in the base class and overwritten in the the derived class) work fine, it's just this one function. ...
2
1956
by: Chris Michael | last post by:
Hello everybody, Newbie here. I've been working on this for the last two days and I can't figure out where this problem is. I think it's something so obvious, but I can't see it! OK, firstly in a very simple page (please see www.intomobiles.com/test3.htm - it just displays the code that i use in an asp page) I call a function "processForm". The actual form is described in an asp page and is SSI linked to the page (for the full...
4
3399
by: mangi03 | last post by:
Hi, I came acrosss g++ compile errors whenever I make a function call by reference and found out from the test program that compiler is treating the function argument differently when another function call funcRet()is made which returns the expected argument type for the function call by reference funcByRef(class A&); The only way to get around this probelm is to first call the funcRet(), assign its value to a variable and pass that...
2
9805
by: Chuck Martin | last post by:
I am having a most frustrating problem that references, web searches, and other resources are no help so far in solving. Basically, I'm trying to design a pop-up window to be called with a funciton in a link. that function can have parameters for URL and window name passed to it. This works peachy in Firefox (1.0). With IE 6 (6.0.29) on two separate computers, I get an "onject expected" error. Going to the MS-based debugger just tells me...
9
4010
by: daniel | last post by:
Hi everyone, I'm trying to get this program compiled under Solaris. Unfortunately I have little experience with C. Solaris doesn't use the function strsep() anymore: char *strsep(char **stringp, const char *delim);
5
1715
by: mk | last post by:
Greetings all - im new to this newsgroup so pls dont flame me :p I need some help! Please view the html below in a browser. Or goto this url -http://firebrain.co.uk/java-problem.htm (Assuming you have seen the rendered code) Basically I need the X buttons to change all the values of each textbox to zero either in the col or row depending on which button is clicked. Function summery: If you click on a X button on the right hand side of...
3
8635
by: drummond.ian | last post by:
Hello Everyone, This problem's been causing me a lot of trouble and I'm hoping somebody can help me out!! I have a dialog-based MFC application in visual studio 2003. I want to call a function called "OnPrintMsg" from my dialog class called "MyAppDlg.h". The function needs to be called from another class called "Client.cpp". The Client class (derived from the CSockets class) exists as described below.
9
2906
by: shror | last post by:
hi every body, i have a problem which is when i was checking my mail() form it work fine but the problem is that the form configuration is not set correctly, in details: the from var is not working and the from is set to be my host provider email is the sender, so they told me to configure the php.ini file and i dont know what is this file and how to configure it. thanks in advance
8
1661
by: cpptutor2000 | last post by:
Could some C guru please help me? I have a function that takes as an argument a pointer to an array of unsigned chars (basically a hex representation of a dotted decimal IP address). When I print out the received values in the receiving function, I get something completely different from what I passed in. The following are the relevant code snippets: In the calling function: unsigned char* TempAddrs = {"0xC0", "0xA8", "0x00", "0x63"};
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.