473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

strpbrk(...) vs. strcspn(...)

What is the difference between these two functions?
Nov 17 '05 #1
2 2758
In article <73**********************************@microsoft.co m>,
an*******@discussions.microsoft.com says...
What is the difference between these two functions?


strcspn returns a character position where strpbrk returns a pointer.
Other than that, if no character is found, strpbrk returns a null
pointer; IIRC, under the same circumstances strcspn returns the index
of the NUL at the end of the string (which is rarely useful).

--
Later,
Jerry.

The universe is a figment of its own imagination.
Nov 17 '05 #2
They go back to the days of C when stupid, unrememberable names were common. The reason is there were no namespaces, classes or function overloading to keep things straight.
Nov 17 '05 #3

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

Similar topics

226
by: Stephen C. Waterbury | last post by:
This seems like it ought to work, according to the description of reduce(), but it doesn't. Is this a bug, or am I missing something? Python 2.3.2 (#1, Oct 20 2003, 01:04:35) on linux2 Type...
11
by: amanayin | last post by:
size_t strcspn(char *str1, char *str2); char *strpbrk(char *str, char *accept); In the book i am using it says: The function strpbrk() returns a pointer to the first character in str that...
9
by: dreamcatcher | last post by:
since strcpy is the abbreviation for string copy, so I wonder what strspn and strpbrk stands for ? -- Posted via http://dbforums.com
2
by: Vaddina Prakash Rao | last post by:
Hi all .. I describe here a wierd behaviour .. i dont understand why ... This could be very stupid aswell .. so please bear me .. I have been writing a program to accept multiple parameters and...
9
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...
13
by: ern | last post by:
I'm using strtok( ) to capture lines of input. After I call "splitCommand", I call strtok( ) again to get the next line. Strtok( ) returns NULL (but there is more in the file...). That didn't...
167
by: shaanxxx | last post by:
I started programming with c. Lot of projects are being done in C++. We have to move in THE C++. I read around 3 - 4 books (including Faqs, stroustrup) on c++. What i found in most of the book is...
12
by: bahadir.balban | last post by:
Hi, How do you check string intersection? There doesn't seem to be a library function to do that, e.g: +#include <linux/string.h> + +/* AND'ing two strings (checks intersection) */ +static...
3
by: sosij.morris | last post by:
The 'spec' is to write a 'whereis' program for Windows. There was no need to have argv be valid sot hat bit I've added. The spec also said that to detect an existing file, one could use...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.