![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing global variable to a function which is called by another function | sars | Shell Programming and Scripting | 4 | 06-30-2008 11:39 AM |
| strtok equivalent in perl | jisha | Shell Programming and Scripting | 1 | 05-06-2008 03:38 AM |
| Regardign strtok() output directing to 2-D string array | SankarV | High Level Programming | 3 | 04-28-2008 09:48 AM |
| Function within function (Recurance) | chassis | UNIX for Dummies Questions & Answers | 2 | 09-19-2006 09:32 AM |
| better way than strtok? | annie | High Level Programming | 7 | 10-05-2005 02:01 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Strtok function....
can any help me out y dis program is giving me a segmentation fault.....
#include<stdio.h> #include<string.h> int main() { char *str="Tanvir/home/root/hello"; const char *d ="/"; char *ret; ret=strtok(str,d); if(ret==NULL) printf("NULL NULL"); else printf("\n%c",ret); return 0; } |
|
||||
|
Quote:
You could change that to, Code:
char str[]="Tanvir/home/root/hello"; Nagarajan G |
|
||||
|
Quote:
Thanks for ur detailed explaination of strtok. I fully agree with ur comment. but however strtok should not be used in threads. can u explain me why? they say in such case its safe to use strtok_r(). Regards -Ashok Meti |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|